Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'fix_deprecation_warning' of git://github.com/botandrose…

…/cucumber-rails
  • Loading branch information...
commit 30e5e36d1de6122c33efa09859a3e7d9cc088c5e 2 parents ddfb7eb + aa7cbe2
@aslakhellesoy aslakhellesoy authored
Showing with 1 addition and 7 deletions.
  1. +1 −7 lib/cucumber/rails/hooks/active_record.rb
View
8 lib/cucumber/rails/hooks/active_record.rb
@@ -1,6 +1,6 @@
if defined?(ActiveRecord::Base)
class ActiveRecord::Base
- class_inheritable_accessor :shared_connection
+ class_attribute :shared_connection
def self.connection
self.shared_connection || retrieve_connection
@@ -12,16 +12,10 @@ def self.connection
# as connections may vary per model as per establish_connection. This works
# on Capybara because it starts the web server in a thread.
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
- ActiveRecord::Base.descendants.each do |model|
- model.shared_connection = model.connection
- end
end
Before('~@javascript') do
# Do not use a shared connection unless we're in a @javascript scenario
ActiveRecord::Base.shared_connection = nil
- ActiveRecord::Base.descendants.each do |model|
- model.shared_connection = nil
- end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.