Class: Ripple::SearchableObserver

Inherits:
ActiveModel::Observer
  • Object
show all
Defined in:
lib/ripple_searchable/searchable_observer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.observed_classesObject



9
10
11
# File 'lib/ripple_searchable/searchable_observer.rb', line 9

def self.observed_classes
  @observed_classes ||= []
end

Instance Method Details

#after_save(m) ⇒ Object



13
14
15
# File 'lib/ripple_searchable/searchable_observer.rb', line 13

def after_save(m)
  Ripple.client.index(m.class.bucket_name, m.attributes.reject {|k,v| v.nil?}.merge(id: m.id))
end