def spawn(options = {})
options.symbolize_keys!
if options[:method] == :yield || (options[:method] == nil && @@method == :yield)
yield
elsif options[:method] == :thread || (options[:method] == nil && @@method == :thread)
if RAILS_2_2 || ActiveRecord::Base.allow_concurrency
thread_it(options) { yield }
else
@@logger.error("spawn(:method=>:thread) only allowed when allow_concurrency=true")
raise "spawn requires config.active_record.allow_concurrency=true when used with :method=>:thread"
end
else
fork_it(options) { yield }
end
end