Sha256: e11aa898e1bf1eaa609ea55fe237ab6efecdbe291e78ae866a21fd53bb0d3012

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

# encoding: utf-8

module PagesCore
  module PageModel
    module Searchable
      extend ActiveSupport::Concern

      included do
        after_save ThinkingSphinx::RealTime.callback_for(:page)
      end

      def localization_values
        localizations.map(&:value)
      end

      def category_names
        categories.map(&:name)
      end

      def comment_names
        comments.map(&:name)
      end

      def comment_bodies
        comments.map(&:body)
      end

      def file_names
        files.map(&:name)
      end

      def file_filenames
        files.map(&:filename)
      end

      def published
        published?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.5.1 app/models/concerns/pages_core/page_model/searchable.rb