Module: ActiveAny::Associations::ClassMethods

Defined in:
lib/active_any/associations.rb

Instance Method Summary collapse

Instance Method Details

#belongs_to(name, scope = nil, options = {}) ⇒ Object



33
34
35
36
# File 'lib/active_any/associations.rb', line 33

def belongs_to(name, scope = nil, options = {})
  reflection = Builder::BelongsTo.build(self, name, scope, options)
  Reflection.add_reflection self, name, reflection
end

#has_many(name, scope = nil, options = {}) ⇒ Object



28
29
30
31
# File 'lib/active_any/associations.rb', line 28

def has_many(name, scope = nil, options = {})
  reflection = Builder::HasMany.build(self, name, scope, options)
  Reflection.add_reflection self, name, reflection
end