Module: Panda::Finders::FindMany

Included in:
Proxy, Resource
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 (private)



50
51
52
53
54
55
56
57
# File 'lib/panda/modules/finders.rb', line 50

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



37
38
39
# File 'lib/panda/modules/finders.rb', line 37

def all(map={})
  find_by_path(many_path, map)
end

#find_by(map) ⇒ Object



33
34
35
# File 'lib/panda/modules/finders.rb', line 33

def find_by(map)
  all(map).first
end