Sha256: 1b758c0337611c786a478a9d386ccd799cbaa3216ff03845c5458409f9fd1c37

Contents?: true

Size: 609 Bytes

Versions: 11

Compression:

Stored size: 609 Bytes

Contents

case (Rails::VERSION::MAJOR)
when 2
  if (defined?(ActiveRecord) and defined?(ActiveRecord::Base))
    ActiveRecord::Base.send(:include, TestDummy)
  end
  if (defined?(ActiveSupport) and defined?(ActiveSupport::TestCase))
    ActiveSupport::TestCase.send(:include, TestDummy::TestHelper)
  end
else
  class TestDummy::Railtie < Rails::Railtie
    def self.apply!
      if (defined?(ActiveRecord))
        ActiveRecord::Base.send(:include, TestDummy)
      end

      ActiveSupport::TestCase.send(:include, TestDummy::TestHelper)
    end
    
    config.before_configuration do
      apply!
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
test_dummy-0.2.10 lib/test_dummy/railtie.rb
test_dummy-0.2.9 lib/test_dummy/railtie.rb
test_dummy-0.2.8 lib/test_dummy/railtie.rb
test_dummy-0.2.7 lib/test_dummy/railtie.rb
test_dummy-0.2.6 lib/test_dummy/railtie.rb
test_dummy-0.2.5 lib/test_dummy/railtie.rb
test_dummy-0.2.4 lib/test_dummy/railtie.rb
test_dummy-0.2.3 lib/test_dummy/railtie.rb
test_dummy-0.2.2 lib/test_dummy/railtie.rb
test_dummy-0.2.1 lib/test_dummy/railtie.rb
test_dummy-0.2.0 lib/test_dummy/railtie.rb