Method: StaticModel::Base.where

Defined in:
lib/static_model/base.rb

.where(criteria = {}) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/static_model/base.rb', line 35

def self.where(criteria = {})
  all.select do |record|
    criteria.all? do |attribute, value|
      record.respond_to?(attribute) && record.__send__(attribute) == value
    end
  end
end