Sha256: 5b1e6cdb6e67df43e4123380951e376b9523a73d59e785fb1f88480fe74b670f
Contents?: true
Size: 1.13 KB
Versions: 9
Compression:
Stored size: 1.13 KB
Contents
class Card class Director module CardMethods attr_writer :director delegate :validation_phase, :storage_phase, :integration_phase, :validation_phase_callback?, :integration_phase_callback?, to: :director def director @director ||= Director.fetch self end def prepare_for_phases reset_patterns identify_action include_set_modules end def identify_action @action = if trash && trash_changed? :delete elsif new_card? :create else :update end end def restore_changes_information # restores changes for integration phase # (rails cleared them in an after_create/after_update hook which is # executed before the integration phase) return unless saved_changes.present? @mutations_from_database = mutations_before_last_save end def clear_action_specific_attributes self.class.action_specific_attributes.each do |attr| instance_variable_set "@#{attr}", nil end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems