Module: ActsAsFerret::WithoutAR::ClassMethods
- Defined in:
- lib/acts_as_ferret/without_ar.rb
Instance Method Summary collapse
- #count ⇒ Object
- #find(what, args = {}) ⇒ Object
- #find_for_id(id) ⇒ Object
- #logger ⇒ Object
- #primary_key ⇒ Object
- #table_name ⇒ Object
Instance Method Details
#count ⇒ Object
37 38 39 |
# File 'lib/acts_as_ferret/without_ar.rb', line 37 def count 0 end |
#find(what, args = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/acts_as_ferret/without_ar.rb', line 25 def find(what, args = {}) case what when :all ids = args[:conditions][1] ids.map { |id| find id } else find_for_id what end end |
#find_for_id(id) ⇒ Object
34 35 36 |
# File 'lib/acts_as_ferret/without_ar.rb', line 34 def find_for_id(id) raise NotImplementedError.new("implement find_for_id in class #{self.name}") end |
#logger ⇒ Object
16 17 18 |
# File 'lib/acts_as_ferret/without_ar.rb', line 16 def logger RAILS_DEFAULT_LOGGER end |
#primary_key ⇒ Object
22 23 24 |
# File 'lib/acts_as_ferret/without_ar.rb', line 22 def primary_key 'id' end |
#table_name ⇒ Object
19 20 21 |
# File 'lib/acts_as_ferret/without_ar.rb', line 19 def table_name self.name.underscore end |