Module: ActivePropagation::InstanceExtensions
- Defined in:
- lib/active_propagation/instance_extensions.rb
Instance Attribute Summary collapse
-
#_active_propagation_changes ⇒ Object
readonly
Returns the value of attribute _active_propagation_changes.
Instance Method Summary collapse
Instance Attribute Details
#_active_propagation_changes ⇒ Object (readonly)
Returns the value of attribute _active_propagation_changes.
3 4 5 |
# File 'lib/active_propagation/instance_extensions.rb', line 3 def _active_propagation_changes @_active_propagation_changes end |
Instance Method Details
#_run_active_propagation ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/active_propagation/instance_extensions.rb', line 5 def _run_active_propagation klass = self.class klass.class_variable_get(:@@propagations).each do |association, config| args = [self.class.to_s, self.id, association.to_s, config[:only]] if self.destroyed? if config[:async] ActivePropagation::AsyncDeletor.run(*args) else ActivePropagation::Deletor.run(*args) end elsif (_active_propagation_changes.keys.map(&:to_s) & config[:only].map(&:to_s)).any? if config[:async] ActivePropagation::AsyncUpdater.run(*args) else ActivePropagation::Updater.run(*args) end end end end |
#_save_active_propagation_changes ⇒ Object
25 26 27 |
# File 'lib/active_propagation/instance_extensions.rb', line 25 def _save_active_propagation_changes @_active_propagation_changes ||= self.changes end |