Class: ActiveForce::Association::BuildFromArray

Inherits:
AbstractBuildFrom show all
Defined in:
lib/active_force/association/relation_model_builder.rb

Direct Known Subclasses

BuildFromRestforce_Collection

Instance Attribute Summary

Attributes inherited from AbstractBuildFrom

#association, #association_mapping, #value

Instance Method Summary collapse

Methods inherited from AbstractBuildFrom

#initialize

Constructor Details

This class inherits a constructor from ActiveForce::Association::AbstractBuildFrom

Instance Method Details

#callObject



52
53
54
55
56
57
58
# File 'lib/active_force/association/relation_model_builder.rb', line 52

def call
  if association.is_a?(HasOneAssociation)
    association.build(value.first, association_mapping)
  else
    value.map { |mash| association.build(mash, association_mapping) }
  end
end