Skip to content

Commit

Permalink
Use strings primary keys in identity map keys to avoid problems with …
Browse files Browse the repository at this point in the history
…casting and also allow strings primary keys.
  • Loading branch information
miloops committed Nov 19, 2010
1 parent a3210d9 commit 0f16949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord/lib/active_record/identity_map.rb
Expand Up @@ -29,15 +29,15 @@ def without
end

def get(class_name, primary_key)
current[[class_name, primary_key]]
current[[class_name, primary_key.to_s]]
end

def add(record)
current[[record.class.name, record.id]] = record
current[[record.class.name, record.id.to_s]] = record
end

def remove(record)
current.delete([record.class.name, record.id])
current.delete([record.class.name, record.id.to_s])
end

def clear
Expand Down

0 comments on commit 0f16949

Please sign in to comment.