Skip to content

Commit

Permalink
fix identity_map primary key checking
Browse files Browse the repository at this point in the history
  • Loading branch information
funny-falcon authored and jeremyevans committed Apr 12, 2011
1 parent 4ed6c4f commit 9eac333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sequel/plugins/identity_map.rb
Expand Up @@ -123,7 +123,7 @@ def _associated_object_pk(fk)
# map for the associated object and return it if present.
def _load_associated_objects(opts)
klass = opts.associated_class
if klass.respond_to?(:identity_map) && idm = klass.identity_map and opts[:type] == :many_to_one and opts[:primary_key] == klass.primary_key and
if klass.respond_to?(:identity_map) && idm = klass.identity_map and opts[:type] == :many_to_one and opts.primary_key == klass.primary_key and
opts[:key] and pk = _associated_object_pk(opts[:key]) and o = idm[klass.identity_map_key(pk)]
o
else
Expand Down

0 comments on commit 9eac333

Please sign in to comment.