Module: Card::Director::CardMethods
- Included in:
- Card
- Defined in:
- lib/card/director/card_methods.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #clear_action_specific_attributes ⇒ Object
- #identify_action ⇒ Object
- #prepare_for_phases ⇒ Object
- #restore_changes_information ⇒ Object
Instance Attribute Details
Instance Method Details
#clear_action_specific_attributes ⇒ Object
38 39 40 41 42 |
# File 'lib/card/director/card_methods.rb', line 38 def clear_action_specific_attributes self.class.action_specific_attributes.each do |attr| instance_variable_set "@#{attr}", nil end end |
#identify_action ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/card/director/card_methods.rb', line 18 def identify_action @action = if trash && trash_changed? :delete elsif new_card? :create else :update end end |
#prepare_for_phases ⇒ Object
12 13 14 15 16 |
# File 'lib/card/director/card_methods.rb', line 12 def prepare_for_phases reset_patterns identify_action include_set_modules end |
#restore_changes_information ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/card/director/card_methods.rb', line 29 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 |