Skip to content

Commit

Permalink
Fix for #151.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Savage committed Mar 16, 2014
1 parent 3ce5edc commit cc76758
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/composite_primary_keys/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def id=(ids)

def ==(comparison_object)
return true if equal? comparison_object
ids.is_a?(Array) ? super(comparison_object) && ids.all? {|id| id.present?} : super(comparison_object)
ids.is_a?(Array) ? super(comparison_object) && ids.all? {|id| !id.nil?} : super(comparison_object)

This comment has been minimized.

Copy link
@seashell-qd

seashell-qd Apr 30, 2014

Contributor

The change makes below testing fail.

FAIL TestEqual#test_new (0.00s)
Expected #<Capitol country: "", city: ""> to not be equal to #<Capitol country: "", city: "">.
/home/yunpeng/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/composite_primary_keys-ef86f485a230/test/test_equal.rb:7:in `test_new'

Should we always return [nil, nil, ...] as id for new records?

end

def can_change_primary_key_values?
Expand Down

0 comments on commit cc76758

Please sign in to comment.