Sha256: 6e9ddd0497e6748b8f6e95f1347133d33740150cf124be2afb398ef9b0960810

Contents?: true

Size: 374 Bytes

Versions: 8

Compression:

Stored size: 374 Bytes

Contents

require_dependency Locomotive::Engine.root.join('app', 'models', 'locomotive', 'page').to_s

Locomotive::Page.class_eval do
  include Locomotive::Search::Extension
  
  search_by [:title, store: [:title, :slug, :site_id]], unless: :not_found?
  
  def indexable_id
    if respond_to?(:site_id)
      "site_#{site_id}_page_#{id}"
    else
      "page_#{id}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
locomotivecms-search-0.2.5 app/models/locomotive/page.rb
locomotivecms-search-0.2.4 app/models/locomotive/page.rb
locomotivecms-search-0.2.3 app/models/locomotive/page.rb
locomotivecms-search-0.2.2 app/models/locomotive/page.rb
locomotivecms-search-0.2.1 app/models/locomotive/page.rb
locomotivecms-search-0.2.0 app/models/locomotive/page.rb
locomotivecms-search-0.1.0 app/models/locomotive/page.rb
locomotivecms-search-0.0.5 app/models/locomotive/page.rb