Class: ActiveRecord::Associations::JoinDependency::JoinBase

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord_bulkoperation/active_record/associations/associations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cached_recordObject

Returns the value of attribute cached_record.



166
167
168
# File 'lib/activerecord_bulkoperation/active_record/associations/associations.rb', line 166

def cached_record
  @cached_record
end

Instance Method Details

#extract_record(row, column_names_with_alias) ⇒ Object



168
169
170
171
172
173
174
# File 'lib/activerecord_bulkoperation/active_record/associations/associations.rb', line 168

def extract_record(row,column_names_with_alias)
  # if the :select option is set, only the selected field should be extracted
  # column_names_with_alias.inject({}){|record, (cn, an)| record[cn] = row[an] if row.has_key?(an); record}
  record = {}
  column_names_with_alias.each { |(cn, an)| record[cn] = row[an] if row.key?(an) }
  record
end

#instantiate(row, aliases) ⇒ Object



176
177
178
# File 'lib/activerecord_bulkoperation/active_record/associations/associations.rb', line 176

def instantiate(row, aliases)          
  instantiate_without_save_original(row, aliases)
end

#instantiate_without_save_originalObject



175
# File 'lib/activerecord_bulkoperation/active_record/associations/associations.rb', line 175

alias_method :instantiate_without_save_original, :instantiate