Permalink
Browse files

Fixed bug in Base#hash method that would treat records with the same …

…string-based id as different [Dave Thomas]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1039 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ea3016f commit cfef86c6454482993872557eb57b2a37e0fefdd5 @dhh dhh committed Mar 30, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/base.rb
@@ -1,5 +1,7 @@
*SVN*
+* Fixed bug in Base#hash method that would treat records with the same string-based id as different [Dave Thomas]
+
* Renamed DateHelper#distance_of_time_in_words_to_now to DateHelper#time_ago_in_words (old method name is still available as a deprecated alias)
@@ -1085,7 +1085,7 @@ def eql?(comparison_object)
# Delegates to id in order to allow two records of the same type and id to work with something like:
# [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ]
def hash
- id
+ id.hash
end
# For checking respond_to? without searching the attributes (which is faster).

0 comments on commit cfef86c

Please sign in to comment.