Module: FmStore::Finders

Defined in:
lib/fm_store/finders.rb

Instance Method Summary collapse

Instance Method Details

#criteriaObject



18
19
20
# File 'lib/fm_store/finders.rb', line 18

def criteria
  Criteria.new(self)
end

#criteria_queryObject



22
23
24
# File 'lib/fm_store/finders.rb', line 22

def criteria_query
  Criteria.new(self, true)
end

#totalObject

Will always return an array properly cast to the correct type def find(hash_or_record_id, options = {})

where(hash_or_record_id, options)

end



31
32
33
# File 'lib/fm_store/finders.rb', line 31

def total
  criteria.paginate(:per_page => 1).total_entries
end