diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 14:19:03 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 14:48:44 +0000 |
commit | deb91690ae0883826950fa2cfb7c23944d7f03de (patch) | |
tree | 166d16e22751fce5eb5776c0c6e2274b10cd1468 | |
parent | 6696f7e01026a9199d899f0b0a88763ba5bc020e (diff) | |
download | rails-deb91690ae0883826950fa2cfb7c23944d7f03de.tar.gz rails-deb91690ae0883826950fa2cfb7c23944d7f03de.tar.bz2 rails-deb91690ae0883826950fa2cfb7c23944d7f03de.zip |
Intercept sends in Model::DeprecationProxy
-rw-r--r-- | activerecord/lib/active_record/model.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/inclusion_test.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/model.rb b/activerecord/lib/active_record/model.rb index 44051f1a71..f87be257db 100644 --- a/activerecord/lib/active_record/model.rb +++ b/activerecord/lib/active_record/model.rb @@ -78,6 +78,8 @@ module ActiveRecord Base.send(name, *args, &block) end end + + alias send method_missing end end end diff --git a/activerecord/test/cases/inclusion_test.rb b/activerecord/test/cases/inclusion_test.rb index 4b4590e218..f2c442c2e1 100644 --- a/activerecord/test/cases/inclusion_test.rb +++ b/activerecord/test/cases/inclusion_test.rb @@ -84,14 +84,16 @@ class InclusionUnitTest < ActiveRecord::TestCase assert_equal ActiveRecord::Model.name, ActiveRecord::Model::DeprecationProxy.name assert_equal ActiveRecord::Base.superclass, assert_deprecated { ActiveRecord::Model::DeprecationProxy.superclass } - sup = nil + sup, sup2 = nil, nil ActiveSupport.on_load(:__test_active_record_model_deprecation) do sup = superclass + sup2 = send(:superclass) end assert_deprecated do ActiveSupport.run_load_hooks(:__test_active_record_model_deprecation, ActiveRecord::Model::DeprecationProxy) end assert_equal ActiveRecord::Base.superclass, sup + assert_equal ActiveRecord::Base.superclass, sup2 end end |