Module: ElasticRecord::SearchesMany::Autosave::ClassMethods

Defined in:
lib/elastic_record/searches_many/autosave.rb

Instance Method Summary collapse

Instance Method Details

#add_autosave_after_save_callbacks(reflection) ⇒ Object



12
13
14
# File 'lib/elastic_record/searches_many/autosave.rb', line 12

def add_autosave_after_save_callbacks(reflection)
  before_save { save_autosave_records(reflection) }
end

#add_autosave_callbacks(reflection) ⇒ Object



7
8
9
10
# File 'lib/elastic_record/searches_many/autosave.rb', line 7

def add_autosave_callbacks(reflection)
  add_autosave_after_save_callbacks(reflection)
  add_autosave_validation_callbacks(reflection)
end

#add_autosave_validation_callbacks(reflection) ⇒ Object



16
17
18
# File 'lib/elastic_record/searches_many/autosave.rb', line 16

def add_autosave_validation_callbacks(reflection)
  validate { validate_autosave_records(reflection) }
end