diff options
author | Will <will@makisu.local> | 2009-12-16 10:49:06 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-16 10:49:53 -0600 |
commit | bf6af5f71917b5615edb5905729b22772133eea4 (patch) | |
tree | 5a7a3d79c7f9288ac52151acbef7be45e1171f7a /activerecord/lib/active_record | |
parent | 1b27f5c4f72384081083fa025b6b10e5ab02ae5e (diff) | |
download | rails-bf6af5f71917b5615edb5905729b22772133eea4.tar.gz rails-bf6af5f71917b5615edb5905729b22772133eea4.tar.bz2 rails-bf6af5f71917b5615edb5905729b22772133eea4.zip |
When passing force_reload = true to an association, don't use the query cache [#1827 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 0fcd288fc5..8dcb3a7711 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1325,7 +1325,7 @@ module ActiveRecord if association.nil? || force_reload association = association_proxy_class.new(self, reflection) - retval = association.reload + retval = force_reload ? reflection.klass.uncached { association.reload } : association.reload if retval.nil? and association_proxy_class == BelongsToAssociation association_instance_set(reflection.name, nil) return nil @@ -1370,7 +1370,7 @@ module ActiveRecord association_instance_set(reflection.name, association) end - association.reload if force_reload + reflection.klass.uncached { association.reload } if force_reload association end |