Class: ActiveRecord::Associations::JoinDependency::JoinBase
- Inherits:
-
Object
- Object
- ActiveRecord::Associations::JoinDependency::JoinBase
- Defined in:
- lib/activerecord_bulkoperation/active_record/associations/associations.rb
Instance Attribute Summary collapse
-
#cached_record ⇒ Object
Returns the value of attribute cached_record.
Instance Method Summary collapse
- #extract_record(row, column_names_with_alias) ⇒ Object
- #instantiate(row, aliases) ⇒ Object
- #instantiate_without_save_original ⇒ Object
Instance Attribute Details
#cached_record ⇒ Object
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_original ⇒ Object
175 |
# File 'lib/activerecord_bulkoperation/active_record/associations/associations.rb', line 175 alias_method :instantiate_without_save_original, :instantiate |