Module: Panda::Finders::FindMany
- Included in:
- Proxy
- Defined in:
- lib/panda/modules/finders.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_symbol, *arguments) ⇒ Object
56
57
58
59
60
61
62
63
|
# File 'lib/panda/modules/finders.rb', line 56
def method_missing(method_symbol, *arguments)
method_name = method_symbol.to_s
if method_name =~ /^find_all_by_([_a-zA-Z]\w*)$/
find_all_by_has_many($1, arguments.pop)
else
super
end
end
|
Instance Method Details
#all(map = {}) ⇒ Object
43
44
45
|
# File 'lib/panda/modules/finders.rb', line 43
def all(map={})
find_by_path(many_path, map)
end
|
#find_by(map) ⇒ Object
39
40
41
|
# File 'lib/panda/modules/finders.rb', line 39
def find_by(map)
all(map).first
end
|