Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed controller_runtime bug

  • Loading branch information...
commit 87fbff68488ed92160aba309d706592659b7484c 1 parent e6e65b0
@brasten authored
View
1  CHANGELOG
@@ -1,5 +1,6 @@
== 0.1.2
* fixed log_subscriber bug that 0.1.1 was -supposed- to fix.
+* fixed controller_runtime bug
== 0.1.1
* bug fixes, no additional functionality
View
6 lib/sequel-rails/railties/controller_runtime.rb
@@ -13,11 +13,9 @@ module ControllerRuntime
attr_internal :db_runtime
def cleanup_view_runtime
- # TODO add checks if Sequel is connected to a repository.
- # If it is, do this, if it isn't, just delegate to super
- db_rt_before_render = ::Sequel.repository.adapter.reset_runtime
+ db_rt_before_render = ::Rails::Sequel.reset_runtime
runtime = super
- db_rt_after_render = ::Sequel.repository.adapter.reset_runtime
+ db_rt_after_render = ::Rails::Sequel.reset_runtime
self.db_runtime = db_rt_before_render + db_rt_after_render
runtime - db_rt_after_render
end
View
14 lib/sequel-rails/runtime.rb
@@ -0,0 +1,14 @@
+module Rails
+ module Sequel
+
+ class << self
+ def reset_runtime
+ @runtime ||= 0
+
+ rt, @runtime = @runtime, 0
+ rt
+ end
+ end
+
+ end
+end
View
1  lib/sequel-rails/setup.rb
@@ -3,6 +3,7 @@
require 'sequel/extensions/migration'
require 'sequel-rails/configuration'
+require 'sequel-rails/runtime'
require 'sequel-rails/railties/benchmarking_mixin'
module Rails
Please sign in to comment.
Something went wrong with that request. Please try again.