Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Check for a dynamic callback before using an identity_map cached valu…

…e for a many_to_one association
  • Loading branch information...
commit ab739622d270dce0e0fe59af071a4726045bf381 1 parent a6383da
Jeremy Evans authored April 13, 2011

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/sequel/plugins/identity_map.rb
2  lib/sequel/plugins/identity_map.rb
@@ -123,7 +123,7 @@ def _associated_object_pk(fk)
123 123
         # map for the associated object and return it if present.
124 124
         def _load_associated_objects(opts, dynamic_opts={})
125 125
           klass = opts.associated_class
126  
-          if klass.respond_to?(:identity_map) && idm = klass.identity_map and opts[:type] == :many_to_one and opts.primary_key == klass.primary_key and
  126
+          if !dynamic_opts[:callback] && klass.respond_to?(:identity_map) && idm = klass.identity_map and opts[:type] == :many_to_one and opts.primary_key == klass.primary_key and
127 127
            opts[:key] and pk = _associated_object_pk(opts[:key]) and o = idm[klass.identity_map_key(pk)]
128 128
             o
129 129
           else

0 notes on commit ab73962

Please sign in to comment.
Something went wrong with that request. Please try again.