Class: Calagator::DuplicateChecking::DuplicateSquasher::SingleSquasher
- Inherits:
-
Struct
- Object
- Struct
- Calagator::DuplicateChecking::DuplicateSquasher::SingleSquasher
- Defined in:
- lib/calagator/duplicate_checking/duplicate_squasher.rb
Instance Attribute Summary collapse
-
#duplicate ⇒ Object
Returns the value of attribute duplicate.
-
#master ⇒ Object
Returns the value of attribute master.
-
#model_name ⇒ Object
Returns the value of attribute model_name.
Instance Method Summary collapse
Instance Attribute Details
#duplicate ⇒ Object
Returns the value of attribute duplicate
28 29 30 |
# File 'lib/calagator/duplicate_checking/duplicate_squasher.rb', line 28 def duplicate @duplicate end |
#master ⇒ Object
Returns the value of attribute master
28 29 30 |
# File 'lib/calagator/duplicate_checking/duplicate_squasher.rb', line 28 def master @master end |
#model_name ⇒ Object
Returns the value of attribute model_name
28 29 30 |
# File 'lib/calagator/duplicate_checking/duplicate_squasher.rb', line 28 def model_name @model_name end |
Instance Method Details
#squash ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/calagator/duplicate_checking/duplicate_squasher.rb', line 29 def squash # Transfer any venues that use this now duplicate venue as a master if duplicate.duplicates.any? DuplicateSquasher.new(master, duplicate.duplicates, model_name).squash end squash_associations duplicate.update_attribute(:duplicate_of, master) duplicate end |