Class: Ripple::SearchableObserver
- Inherits:
-
ActiveModel::Observer
- Object
- ActiveModel::Observer
- Ripple::SearchableObserver
- Defined in:
- lib/ripple_searchable/searchable_observer.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.observed_classes ⇒ Object
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 |