Skip to content
Browse files

Intercept sends in Model::DeprecationProxy

  • Loading branch information...
1 parent 6696f7e commit deb91690ae0883826950fa2cfb7c23944d7f03de @jonleighton jonleighton committed
Showing with 5 additions and 1 deletion.
  1. +2 −0 activerecord/lib/active_record/model.rb
  2. +3 −1 activerecord/test/cases/inclusion_test.rb
View
2 activerecord/lib/active_record/model.rb
@@ -78,6 +78,8 @@ def method_missing(name, *args, &block)
Base.send(name, *args, &block)
end
end
+
+ alias send method_missing
end
end
end
View
4 activerecord/test/cases/inclusion_test.rb
@@ -84,14 +84,16 @@ def test_deprecation_proxy
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

0 comments on commit deb9169

Please sign in to comment.
Something went wrong with that request. Please try again.