diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-10-19 18:08:51 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-10-19 18:12:54 +0100 |
commit | 83846838252397b3781eed165ca301e05db39293 (patch) | |
tree | 871c8e6734e82a1d2d6ce9122c5870b80d9f9cfc /activerecord/test | |
parent | 18e979eea3844a9d293a547528d40ffde198b719 (diff) | |
download | rails-83846838252397b3781eed165ca301e05db39293.tar.gz rails-83846838252397b3781eed165ca301e05db39293.tar.bz2 rails-83846838252397b3781eed165ca301e05db39293.zip |
Get rid of the ActiveRecord::Model::DeprecationProxy thing.
I think it's going to be too much pain to try to transition the
:active_record load hook from executing against Base to executing
against Model.
For example, after Model is included in Base, and modules included in
Model will no longer get added to the ancestors of Base.
So plugins which wish to be compatible with both Model and Base should
use the :active_record_model load hook which executes *before* Base gets
loaded.
In general, ActiveRecord::Model is an advanced feature at the moment and
probably most people will continue to inherit from ActiveRecord::Base
for the time being.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/inclusion_test.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/activerecord/test/cases/inclusion_test.rb b/activerecord/test/cases/inclusion_test.rb index 8f095e4953..297c7a9923 100644 --- a/activerecord/test/cases/inclusion_test.rb +++ b/activerecord/test/cases/inclusion_test.rb @@ -82,42 +82,6 @@ class InclusionUnitTest < ActiveRecord::TestCase def test_included_twice @klass.send :include, ActiveRecord::Model end - - def test_deprecation_proxy - proxy = ActiveRecord::Model::DeprecationProxy.new - - assert_equal ActiveRecord::Model.name, proxy.name - assert_equal ActiveRecord::Base.superclass, assert_deprecated { proxy.superclass } - - 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, proxy) - end - assert_equal ActiveRecord::Base.superclass, sup - assert_equal ActiveRecord::Base.superclass, sup2 - end - - test "including in deprecation proxy" do - model, base = ActiveRecord::Model.dup, ActiveRecord::Base.dup - proxy = ActiveRecord::Model::DeprecationProxy.new(model, base) - - mod = Module.new - proxy.include mod - assert model < mod - end - - test "extending in deprecation proxy" do - model, base = ActiveRecord::Model.dup, ActiveRecord::Base.dup - proxy = ActiveRecord::Model::DeprecationProxy.new(model, base) - - mod = Module.new - assert_deprecated { proxy.extend mod } - assert base.singleton_class < mod - end end class InclusionFixturesTest < ActiveRecord::TestCase |