Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/super_diff/active_record/monkey_patches.rb
Overview
rubocop:disable Style/ClassAndModuleChildren
Instance Method Summary collapse
-
#attributes_for_super_diff ⇒ Object
TODO: Remove this monkey patch if possible.
Instance Method Details
#attributes_for_super_diff ⇒ Object
TODO: Remove this monkey patch if possible
6 7 8 9 10 11 12 |
# File 'lib/super_diff/active_record/monkey_patches.rb', line 6 def attributes_for_super_diff id_attr = self.class.primary_key (attributes.keys.sort - [id_attr]).reduce( { id_attr.to_sym => id } ) { |hash, key| hash.merge(key.to_sym => attributes[key]) } end |