Skip to content

Commit

Permalink
DEPRECATION WARNING: ActiveRecord::Base.verification_timeout= has bee…
Browse files Browse the repository at this point in the history
…n deprecated and no longer has any effect.

Please remove all references to verification_timeout=..

Cleanup connection to ActiveRecord's connection pool after dispatch.

Signed-off-by: Jack Dempsey <jack.dempsey@gmail.com>
  • Loading branch information
mlangenberg authored and jackdempsey committed Dec 13, 2008
1 parent 011bfe1 commit 7ec90ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions merb_activerecord/lib/merb/orms/active_record/cleanup.rb
@@ -0,0 +1,6 @@
# This is the default behavior for ActiveRecord when used
# in conjunction with ActionPack's request handling cycle.
# TODO write test
Merb::Controller.after do
ActiveRecord::Base.clear_active_connections!
end
Expand Up @@ -60,7 +60,6 @@ def connect

Thread.new{ loop{ sleep(60*60); ::ActiveRecord::Base.verify_active_connections! } }

::ActiveRecord::Base.verification_timeout = 14400
::ActiveRecord::Base.logger = Merb.logger
::ActiveRecord::Base.configurations = configurations
::ActiveRecord::Base.establish_connection config
Expand Down
1 change: 1 addition & 0 deletions merb_activerecord/lib/merb_activerecord.rb
Expand Up @@ -2,6 +2,7 @@

dependency "activerecord"

require File.join(File.dirname(__FILE__) / "merb" / "orms" / "active_record" / "cleanup" )
require File.join(File.dirname(__FILE__) / "merb" / "orms" / "active_record" / "connection")
Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / "active_record" / "merbtasks"))

Expand Down

2 comments on commit 7ec90ee

@dstrelau
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea when this fix will be released into the merb_activerecord gem?

@jsmestad
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also wondering this…. ?

Please sign in to comment.