Skip to content

Commit

Permalink
ActiveRecord::Base.allow_concurrency has been removed from Rails 3.0.…
Browse files Browse the repository at this point in the history
…3 - changed to check for this method

and call Rails.application.config.allow_concurrency if it isn't present
  • Loading branch information
Dave Smylie committed Sep 1, 2011
1 parent ff26a25 commit fc52089
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/spawn.rb
Expand Up @@ -119,7 +119,8 @@ def spawn(opts = {})
options[:method].call(proc { yield })
elsif options[:method] == :thread
# for versions before 2.2, check for allow_concurrency
if RAILS_2_2 || ActiveRecord::Base.allow_concurrency
if RAILS_2_2 || ActiveRecord::Base.respond_to?(:allow_concurrency) ?
ActiveRecord::Base.allow_concurrency : Rails.application.config.allow_concurrency
thread_it(options) { yield }
else
@@logger.error("spawn(:method=>:thread) only allowed when allow_concurrency=true")
Expand Down

0 comments on commit fc52089

Please sign in to comment.