Sha256: 11e705e0cc9e8ad247820c4036e638a7c05dbf560da979eaf4e252f80ac8394e

Contents?: true

Size: 617 Bytes

Versions: 13

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true

if defined?(ActiveRecord::Base)
  module ActiveRecord
    class Base
      class_attribute :shared_connection

      def self.connection
        shared_connection || retrieve_connection
      end
    end
  end

  Before('@javascript') do
    Cucumber::Rails::Database.before_js if Cucumber::Rails::Database.autorun_database_cleaner
  end

  Before('not @javascript') do
    Cucumber::Rails::Database.before_non_js if Cucumber::Rails::Database.autorun_database_cleaner
  end

  After do
    Cucumber::Rails::Database.after if Cucumber::Rails::Database.autorun_database_cleaner
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cucumber-rails-3.1.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-3.0.1 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-3.0.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-3.0.0.rc.1 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.6.1 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.6.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.5.1 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.5.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.4.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.3.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.2.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-2.0.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-1.8.0 lib/cucumber/rails/hooks/active_record.rb