Module: SitemapSearch::Model
- Defined in:
- lib/sitemap_search/model.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sitemap_search/model.rb', line 2 def self.included(base) base.extend ClassMethods base.send :cattr_accessor, :search_fields base.send :cattr_accessor, :includes if base == Page base.search_fields = [:title, :slug, :breadcrumb, :content] base.search_fields << :draft_content if defined?(ConcurrentDraftExtension) base.includes = [:parts] elsif base == Layout base.search_fields = [:name, :content] base.search_fields << :draft_content if defined?(ConcurrentDraftExtension) elsif defined?(SnippetsExtension) && base == Snippet base.search_fields = [:name, :content] base.search_fields << :draft_content if defined?(ConcurrentDraftExtension) elsif defined?(TemplatesExtension) && base == Template base.search_fields = [:name, :content] elsif defined?(BannerRotatorExtension) && base == Banner base.search_fields = [:name, :description, :background_image, :foreground_image, :link_url] end end |