aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-06-15 18:04:13 +0100
committerJon Leighton <j@jonathanleighton.com>2012-06-15 19:15:37 +0100
commitae3767c799708992f60442ab2e08b9108f01e5ed (patch)
treea24cbb8ca1735dd4b22b6ad3997ec761e249e9be /railties/test
parenta205bf878084d74872fbad45fac030ad2cb74970 (diff)
downloadrails-ae3767c799708992f60442ab2e08b9108f01e5ed.tar.gz
rails-ae3767c799708992f60442ab2e08b9108f01e5ed.tar.bz2
rails-ae3767c799708992f60442ab2e08b9108f01e5ed.zip
Fix observers with AR::Model
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/configuration_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index c1a68c5786..f57391003a 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -618,5 +618,26 @@ module ApplicationTests
make_basic_app
assert app.config.colorize_logging
end
+
+ test "config.active_record.observers" do
+ add_to_config <<-RUBY
+ config.active_record.observers = :foo_observer
+ RUBY
+
+ app_file 'app/models/foo.rb', <<-RUBY
+ class Foo < ActiveRecord::Base
+ end
+ RUBY
+
+ app_file 'app/models/foo_observer.rb', <<-RUBY
+ class FooObserver < ActiveRecord::Observer
+ end
+ RUBY
+
+ require "#{app_path}/config/environment"
+
+ ActiveRecord::Base
+ assert defined?(FooObserver)
+ end
end
end