lib/etl/transform/foreign_key_lookup_transform.rb
# Initialize the SQL resolver. Use the given table and field name to search
# for the appropriate foreign key. The field should be the name of a natural
# key that is used to locate the surrogate key for the record.
#
# The connection argument is optional. If specified it can be either a symbol
# referencing a connection defined in the ETL database.yml file or an actual
# ActiveRecord connection instance. If the connection is not specified then
# the ActiveRecord::Base.connection will be used.
Initialize the SQL resolver. Use the given table and field name to search
for the appropriate foreign key. The field should be the name of a natural
key that is used to locate the surrogate key for the record.

The connection argument is optional. If specified it can be either a symbol
referencing a connection defined in the ETL database.yml file or an actual
ActiveRecord connection instance. If the connection is not specified then
the ActiveRecord::Base.connection will be used.
Initialize the SQL resolver . Use the given table and field name to search for the appropriate foreign key . The field should be the name of a natural key that is used to locate the surrogate key for the record . The connection argument is optional . If specified it can be either a symbol referencing a connection defined in the ETL database . yml file or an actual ActiveRecord connection instance . If the connection is not specified then the ActiveRecord :: Base . connection will be used .
def resolve(value)
    if @use_cache
      cache[value]
    else
      q = "SELECT id FROM #{table_name} WHERE #{@field} = #{@connection.quote(value)}"
      ETL::Engine.logger.debug("Executing query: #{q}")
      @connection.select_value(q)
    end
  end
def resolve ( value ) if @use_cache cache [ value ] else q = "SELECT id FROM #{table_name} WHERE #{@field} = #{@connection.quote(value)}" ETL :: Engine . logger . debug ( "Executing query: #{q}" ) @connection . select_value ( q ) end end
Initialize the SQL resolver.
Initialize the SQL resolver .
value
<not_specific>