Class: ActiveForce::Association::HasManyAssociation

Inherits:
Association
  • Object
show all
Defined in:
lib/active_force/association/has_many_association.rb

Instance Attribute Summary

Attributes inherited from Association

#options, #relation_name

Instance Method Summary collapse

Methods inherited from Association

#foreign_key, #initialize, #load_target, #relation_model, #relationship_name, #represents_sfdc_table?, #scoped?, #scoped_as

Constructor Details

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

Instance Method Details

#sfdc_association_fieldObject



4
5
6
7
8
9
# File 'lib/active_force/association/has_many_association.rb', line 4

def sfdc_association_field
  name = relationship_name.gsub(/__c\z/, '__r')
  match = name.match(/__r\z/)
  # pluralize the table name, and append '__r' if it was there to begin with
  name.sub(match.to_s, '').pluralize + match.to_s
end