Skip to content

Instantly share code, notes, and snippets.

@dzhlobo
Created June 1, 2014 07:21
Show Gist options
  • Save dzhlobo/d149578da6852cfd883f to your computer and use it in GitHub Desktop.
Save dzhlobo/d149578da6852cfd883f to your computer and use it in GitHub Desktop.
# 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