Sha256: ee4688a3d8e3d79ca3927fe51077e8b9245bd409a638965eb78f304bc4b10866

Contents?: true

Size: 1022 Bytes

Versions: 11

Compression:

Stored size: 1022 Bytes

Contents

require 'active_force/association/association'
require 'active_force/association/eager_load_projection_builder'
require 'active_force/association/relation_model_builder'
require 'active_force/association/has_many_association'
require 'active_force/association/has_one_association'
require 'active_force/association/belongs_to_association'
require 'active_force/association/eager_load_builder_for_nested_includes'

module ActiveForce
  module Association
    def associations
      @associations ||= {}
    end

    def find_association name
      associations[name.to_sym]
    end

    def has_many relation_name, options = {}
      associations[relation_name] = HasManyAssociation.new(self, relation_name, options)
    end

    def has_one relation_name, options = {}
      associations[relation_name] = HasOneAssociation.new(self, relation_name, options)
    end

    def belongs_to relation_name, options = {}
      associations[relation_name] = BelongsToAssociation.new(self, relation_name, options)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
active_force-0.24.0 lib/active_force/association.rb
active_force-0.23.0 lib/active_force/association.rb
active_force-0.22.1 lib/active_force/association.rb
active_force-0.22.0 lib/active_force/association.rb
active_force-0.21.0 lib/active_force/association.rb
active_force-0.20.1 lib/active_force/association.rb
active_force-0.20.0 lib/active_force/association.rb
active_force-0.19.0 lib/active_force/association.rb
active_force-0.18.0 lib/active_force/association.rb
active_force-0.17.0 lib/active_force/association.rb
active_force-0.16.0 lib/active_force/association.rb