Module: Livelist::Rails::ActiveRecord
- Defined in:
- lib/livelist/rails/active_record.rb
Instance Method Summary collapse
- #filter(params, options = {}) ⇒ Object
- #filter_for(slug, options = {}) ⇒ Object
- #filters ⇒ Object
- #filters_as_json(params, options = {}) ⇒ Object
Instance Method Details
#filter(params, options = {}) ⇒ Object
25 26 27 |
# File 'lib/livelist/rails/active_record.rb', line 25 def filter(params, = {}) filters.relation(scoped, params, ) end |
#filter_for(slug, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/livelist/rails/active_record.rb', line 12 def filter_for(slug, = {}) filters.create_filter( .merge( :model_name => model_name, :slug => slug ) ) end |
#filters ⇒ Object
8 9 10 |
# File 'lib/livelist/rails/active_record.rb', line 8 def filters @filters ||= FilterCollection.new end |
#filters_as_json(params, options = {}) ⇒ Object
21 22 23 |
# File 'lib/livelist/rails/active_record.rb', line 21 def filters_as_json(params, = {}) filters.as_json(scoped, params, ) end |