Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

only reset instance type count if activerecord instrument configured

  • Loading branch information...
commit 8b3effeda3bfe93ca2e7b915e2af3e676f02f6e4 1 parent 08f6bac
Eirik Dentz Sinclair & Noah Davis authored
View
2  lib/oink/middleware.rb
@@ -54,7 +54,7 @@ def log_activerecord
private
def reset_objects_instantiated
- ActiveRecord::Base.reset_instance_type_count
+ ActiveRecord::Base.reset_instance_type_count if @instruments.include?(:activerecord)
end
end
View
5 spec/oink/middleware_configuration_spec.rb
@@ -40,6 +40,11 @@ def call(env)
ActiveRecord::Base.should_not_receive(:include)
get "/"
end
+
+ it "does not call reset_instance_type_count" do
+ ActiveRecord::Base.should_not_receive(:reset_instance_type_count)
+ get "/"
+ end
end
context "with the activerecord instrument specified" do
Please sign in to comment.
Something went wrong with that request. Please try again.