Module: Flare::ActiveRecord::Hook

Defined in:
lib/flare/active_record.rb

Instance Method Summary collapse

Instance Method Details

#searchable(&block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/flare/active_record.rb', line 8

def searchable(&block)
  Flare.indexed_models << self unless Flare.indexed_models.include?(self)
  
  builder = IndexBuilder.new(&block)
  solr_index = builder.index
  
  write_inheritable_attribute :solr_index, solr_index
  class_inheritable_reader :solr_index
  
  after_save :solr_save
  after_destroy :solr_destroy
  
  include InstanceMethods
  extend ClassMethods
end

#searchable?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/flare/active_record.rb', line 24

def searchable?
  false
end