Sha256: 3f9be87de39293cb06c99785702314ae89f5ae952ad98c5de18d48c9e9c8dc87

Contents?: true

Size: 462 Bytes

Versions: 16

Compression:

Stored size: 462 Bytes

Contents

require_dependency 'landable/search_engine'
require_dependency 'landable/page'

module Landable
  class PageSearchEngine < SearchEngine
    def initialize(filters, options = {})
      super Page.all, filters, options
    end

    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
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
landable-1.13.1 app/models/landable/page_search_engine.rb
landable-1.12.3 app/models/landable/page_search_engine.rb
landable-1.12.2 app/models/landable/page_search_engine.rb
landable-1.12.1 app/models/landable/page_search_engine.rb
landable-1.11.1 app/models/landable/page_search_engine.rb
landable-1.11.0 app/models/landable/page_search_engine.rb
landable-1.10.0.rc2 app/models/landable/page_search_engine.rb
landable-1.10.0.rc1 app/models/landable/page_search_engine.rb
landable-1.9.2 app/models/landable/page_search_engine.rb
landable-1.9.1 app/models/landable/page_search_engine.rb
landable-1.9.0 app/models/landable/page_search_engine.rb
landable-1.9.0.rc2 app/models/landable/page_search_engine.rb
landable-1.9.0.rc1 app/models/landable/page_search_engine.rb
landable-1.8.0 app/models/landable/page_search_engine.rb
landable-1.7.1.rc1 app/models/landable/page_search_engine.rb
landable-1.7.0 app/models/landable/page_search_engine.rb