Module: ActiveForce::Association
- Included in:
- SObject
- Defined in:
- lib/active_force/association.rb,
lib/active_force/association/association.rb,
lib/active_force/association/has_one_association.rb,
lib/active_force/association/has_many_association.rb,
lib/active_force/association/belongs_to_association.rb,
lib/active_force/association/relation_model_builder.rb,
lib/active_force/association/eager_load_projection_builder.rb,
lib/active_force/association/eager_load_builder_for_nested_includes.rb
Defined Under Namespace
Classes: AbstractBuildFrom, AbstractProjectionBuilder, Association, BelongsToAssociation, BelongsToAssociationProjectionBuilder, BuildFromArray, BuildFromHash, BuildFromNilClass, BuildFromRestforce_Collection, BuildFromRestforce_Mash, BuildFromRestforce_SObject, EagerLoadBuilderForNestedIncludes, EagerLoadProjectionBuilder, HasManyAssociation, HasManyAssociationProjectionBuilder, HasOneAssociation, HasOneAssociationProjectionBuilder, InvalidAssociationError, InvalidEagerLoadAssociation, RelationModelBuilder
Instance Method Summary
collapse
Instance Method Details
#associations ⇒ Object
11
12
13
|
# File 'lib/active_force/association.rb', line 11
def associations
@associations ||= {}
end
|
#belongs_to(relation_name, options = {}) ⇒ Object
27
28
29
|
# File 'lib/active_force/association.rb', line 27
def belongs_to relation_name, options = {}
associations[relation_name] = BelongsToAssociation.new(self, relation_name, options)
end
|
#find_association(name) ⇒ Object
15
16
17
|
# File 'lib/active_force/association.rb', line 15
def find_association name
associations[name.to_sym]
end
|
#has_many(relation_name, options = {}) ⇒ Object
19
20
21
|
# File 'lib/active_force/association.rb', line 19
def has_many relation_name, options = {}
associations[relation_name] = HasManyAssociation.new(self, relation_name, options)
end
|
#has_one(relation_name, options = {}) ⇒ Object
23
24
25
|
# File 'lib/active_force/association.rb', line 23
def has_one relation_name, options = {}
associations[relation_name] = HasOneAssociation.new(self, relation_name, options)
end
|