Class: Landable::PageSearchEngine
- Inherits:
-
SearchEngine
- Object
- SearchEngine
- Landable::PageSearchEngine
- Defined in:
- app/models/landable/page_search_engine.rb
Instance Method Summary collapse
- #filter_by!(filters) ⇒ Object
-
#initialize(filters, options = {}) ⇒ PageSearchEngine
constructor
A new instance of PageSearchEngine.
Methods inherited from SearchEngine
#limit!, #meta, #order!, #results
Constructor Details
#initialize(filters, options = {}) ⇒ PageSearchEngine
Returns a new instance of PageSearchEngine.
6 7 8 |
# File 'app/models/landable/page_search_engine.rb', line 6 def initialize(filters, = {}) super Page.all, filters, end |
Instance Method Details
#filter_by!(filters) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/models/landable/page_search_engine.rb', line 10 def filter_by!(filters) if ids = as_array(filters[:ids]) @scope = @scope.where(page_id: ids) end if path = filters[:path].presence @scope = @scope.with_fuzzy_path(path) end end |