File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
lib/super_diff/active_record Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1212- Add official Rails 7.2 support. [ #279 ] ( https://github.com/splitwise/super_diff/pull/279 )
1313- Add official Rails 8.0 support. [ #281 ] ( https://github.com/splitwise/super_diff/pull/281 )
1414
15+ ### Bug fixes
16+
17+ - Fix ` attributes_for_super_diff ` (in monkey patch of ` ActiveRecord::Base ` ) which would fail for classes that don't have a primary key.
18+ ([ #282 ] ( https://github.com/splitwise/super_diff/pull/282 ) )
19+
1520### Other changes
1621
1722- Fix ` logger ` dependency issues in CI. [ #277 ] ( https://github.com/splitwise/super_diff/pull/277 )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ def attributes_for_super_diff
77 id_attr = self . class . primary_key
88
99 ( attributes . keys . sort - [ id_attr ] ) . reduce (
10- { id_attr . to_sym => id }
10+ id_attr . nil? ? { } : { id_attr . to_sym => id }
1111 ) { |hash , key | hash . merge ( key . to_sym => attributes [ key ] ) }
1212 end
1313end
You can’t perform that action at this time.
0 commit comments