Module: Livelist::Rails::ActiveRecord

Defined in:
lib/livelist/rails/active_record.rb

Instance Method Summary collapse

Instance Method Details

#filter(params, options = {}) ⇒ Object



25
26
27
# File 'lib/livelist/rails/active_record.rb', line 25

def filter(params, options = {})
  filters.relation(scoped, params, options)
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, options = {})
  filters.create_filter(
    options.merge(
      :model_name => model_name,
      :slug       => slug
    )
  )
end

#filtersObject



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, options = {})
  filters.as_json(scoped, params, options)
end