Method: Jaysus::Base.find_all_by_attributes

Defined in:
lib/jaysus/base.rb

.find_all_by_attributes(attributes, *values) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/jaysus/base.rb', line 47

def self.find_all_by_attributes(attributes, *values)
  all.each.select do |record|
    attributes.zip(values).all? do |matcher|
      record.send(matcher.first) == matcher.last
    end
  end
end