Sha256: 57d6be8bf653d99a4323177c0dc5dc6670991355c20d37e2186ff7158218e06f

Contents?: true

Size: 464 Bytes

Versions: 2

Compression:

Stored size: 464 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)
      ids = as_array(filters[:ids])
      @scope = @scope.where(page_id: ids) if ids

      path = filters[:path].presence
      return unless path
      @scope = @scope.with_fuzzy_path(path)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 app/models/landable/page_search_engine.rb
landable-1.13.2 app/models/landable/page_search_engine.rb