Module: Hippo::Concerns::AssociationExtensions::ClassMethods

Defined in:
lib/hippo/concerns/association_extensions.rb

Instance Method Summary collapse

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, options = {} )
    opts = extract_private_options( scope, options )
    associations = super
    handle_private_options( 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,options={}, &extension )
    opts = extract_private_options( scope, options )
    associations = super
    handle_private_options( 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, options = {})
    opts = extract_private_options( scope, options )
    associations = super
    handle_private_options( name, opts ) unless opts.empty?
    associations
end