Module: ActiveAny::Associations::ClassMethods
- Defined in:
- lib/active_any/associations.rb
Instance Method Summary collapse
- #belongs_to(name, scope = nil, options = {}) ⇒ Object
- #has_many(name, scope = nil, options = {}) ⇒ Object
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, = {}) reflection = Builder::BelongsTo.build(self, name, scope, ) 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, = {}) reflection = Builder::HasMany.build(self, name, scope, ) Reflection.add_reflection self, name, reflection end |