aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/identity_map.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-10-15 16:33:27 -0300
committerEmilio Tagua <miloops@gmail.com>2010-11-19 19:08:55 -0300
commit48edab9ba07fccfd0c44ecb2b5675383bdb36851 (patch)
tree387211b2feb71fa4ed4fc242d1135c680ef551bb /activerecord/lib/active_record/identity_map.rb
parent333cdcdf5ae42b6c6625f2fd29ae7814ec75d5bf (diff)
downloadrails-48edab9ba07fccfd0c44ecb2b5675383bdb36851.tar.gz
rails-48edab9ba07fccfd0c44ecb2b5675383bdb36851.tar.bz2
rails-48edab9ba07fccfd0c44ecb2b5675383bdb36851.zip
Don't wrap into identity map if it is disabled.
Diffstat (limited to 'activerecord/lib/active_record/identity_map.rb')
-rw-r--r--activerecord/lib/active_record/identity_map.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/identity_map.rb b/activerecord/lib/active_record/identity_map.rb
index 30a2a1eb0f..fe448abfdf 100644
--- a/activerecord/lib/active_record/identity_map.rb
+++ b/activerecord/lib/active_record/identity_map.rb
@@ -98,9 +98,8 @@ module ActiveRecord
end
def call(env)
- ActiveRecord::IdentityMap.use do
- @app.call(env)
- end
+ ActiveRecord::IdentityMap.enabled? ?
+ ActiveRecord::IdentityMap.use { @app.call(env) } : @app.call(env)
end
end
end