Module: Hippo::Concerns::AssociationExtensions::ClassMethods
- Defined in:
- lib/hippo/concerns/association_extensions.rb
Instance Method Summary collapse
- #belongs_to(name, scope = nil, options = {}) ⇒ Object
- #has_many(name, scope = nil, options = {}, &extension) ⇒ Object
- #has_one(name, scope = nil, options = {}) ⇒ Object
Instance Method Details
#belongs_to(name, scope = nil, options = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/hippo/concerns/association_extensions.rb', line 19 def belongs_to(name, scope = nil, = {} ) opts = ( scope, ) associations = super ( name, opts ) unless opts.empty? associations end |
#has_many(name, scope = nil, options = {}, &extension) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/hippo/concerns/association_extensions.rb', line 26 def has_many(name, scope=nil,={}, &extension ) opts = ( scope, ) associations = super ( name, opts ) unless opts.empty? associations end |
#has_one(name, scope = nil, options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/hippo/concerns/association_extensions.rb', line 12 def has_one(name, scope = nil, = {}) opts = ( scope, ) associations = super ( name, opts ) unless opts.empty? associations end |