Created
June 1, 2014 07:21
-
-
Save dzhlobo/d149578da6852cfd883f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Concern: | |
module Searchable | |
extend ActiveSupport::Concern | |
included do | |
include Elasticsearch::Model | |
scope :searchable, -> { where(searchable: true) } | |
end | |
module ClassMethods | |
def search | |
# … | |
end | |
end | |
end | |
#Service class: | |
class Indexer | |
def initialize(model) | |
end | |
def index | |
# … | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment