Permalink
Browse files

fix identity_map primary key checking

  • Loading branch information...
1 parent 4ed6c4f commit 9eac33358423d00529679568321e9046ce984515 @funny-falcon funny-falcon committed with Apr 12, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sequel/plugins/identity_map.rb
@@ -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

0 comments on commit 9eac333

Please sign in to comment.