diff options
author | José Valim <jose.valim@gmail.com> | 2012-04-27 14:58:51 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-04-27 15:00:56 +0200 |
commit | 0a8aec2c97ab93721d5671555f22975da0a20422 (patch) | |
tree | 4380b135417842444993dd8ebac5c9c28947dc0b | |
parent | a6e47b2811508f6d6b49846c473f6fe86ef9bf9c (diff) | |
download | rails-0a8aec2c97ab93721d5671555f22975da0a20422.tar.gz rails-0a8aec2c97ab93721d5671555f22975da0a20422.tar.bz2 rails-0a8aec2c97ab93721d5671555f22975da0a20422.zip |
Revert "Merge pull request #5995 from kennyj/fix_5847-3"
Active Record should be lazy loaded and this pull request
forced Active Record to always be loaded after initialization.
This reverts commit 8cd14c0bc9f9429f03d1181912355d2f48b98157, reversing
changes made to 2f0c8c52e66f1a2a3d1c00efc207f227124e96c2.
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 5 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 22 |
2 files changed, 0 insertions, 27 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index db0102700b..eb2769f1ef 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -128,10 +128,5 @@ module ActiveRecord end end - - config.after_initialize do - # We should load ActiveRecord::Base class before loading an application model. - require "active_record/base" - end end end diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 8351ab3930..27d521485c 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -167,27 +167,5 @@ module ApplicationTests end assert !File.exists?(File.join(app_path, 'db', 'schema_cache.dump')) end - - def test_load_activerecord_base_when_we_use_observers - Dir.chdir(app_path) do - `bundle exec rails g model user; - bundle exec rake db:migrate; - bundle exec rails g observer user;` - - add_to_config "config.active_record.observers = :user_observer" - - assert_equal "0", `bundle exec rails r "puts User.count"`.strip - - app_file "lib/tasks/count_user.rake", <<-RUBY - namespace :user do - task :count => :environment do - puts User.count - end - end - RUBY - - assert_equal "0", `bundle exec rake user:count`.strip - end - end end end |