aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/identity_map.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/identity_map.rb')
-rw-r--r--activerecord/lib/active_record/identity_map.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/identity_map.rb b/activerecord/lib/active_record/identity_map.rb
index 9f95685816..0062682555 100644
--- a/activerecord/lib/active_record/identity_map.rb
+++ b/activerecord/lib/active_record/identity_map.rb
@@ -95,5 +95,17 @@ module ActiveRecord
ActiveRecord::IdentityMap
end
end
+
+ class Middleware
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ @app.call(env)
+ ensure
+ ActiveRecord::IdentityMap.clear
+ end
+ end
end
end