Module: Switchman::ActiveRecord::AutosaveAssociation
- Defined in:
- lib/switchman/active_record/association.rb
Instance Method Summary collapse
Instance Method Details
#record_changed?(reflection, record, key) ⇒ Boolean
184 185 186 187 188 |
# File 'lib/switchman/active_record/association.rb', line 184 def record_changed?(reflection, record, key) record.new_record? || (record.has_attribute?(reflection.foreign_key) && record.send(reflection.foreign_key) != key) || # have to use send instead of [] because sharding record.attribute_changed?(reflection.foreign_key) end |