aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-01-31 08:41:51 +0000
committerJon Leighton <j@jonathanleighton.com>2012-01-31 08:41:51 +0000
commit0bfc504d9ced49d50afa7a8b19680ae7f42c2b24 (patch)
treef8fb46f779285f50c437715e2fb694f16bd3cad9 /activerecord/test/cases/attribute_methods_test.rb
parentc472843bbc498fc0a21cb883c3929e191e061b3c (diff)
downloadrails-0bfc504d9ced49d50afa7a8b19680ae7f42c2b24.tar.gz
rails-0bfc504d9ced49d50afa7a8b19680ae7f42c2b24.tar.bz2
rails-0bfc504d9ced49d50afa7a8b19680ae7f42c2b24.zip
Add workaround and deprecation if the inherited hook is not executed. Closes #4757.
Diffstat (limited to 'activerecord/test/cases/attribute_methods_test.rb')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 0fbe1813fb..fb53eb1a4b 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -770,6 +770,16 @@ class AttributeMethodsTest < ActiveRecord::TestCase
assert_equal "lol", topic.author_name
end
+ def test_inherited_hook_removed
+ parent = Class.new(ActiveRecord::Base)
+ parent.table_name = "posts"
+ def parent.inherited(k)
+ end
+
+ klass = Class.new(parent)
+ assert_deprecated { klass.define_attribute_methods }
+ end
+
private
def cached_columns
@cached_columns ||= time_related_columns_on_topic.map(&:name)