diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index fb53eb1a4b..cdff7ef017 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -780,6 +780,13 @@ class AttributeMethodsTest < ActiveRecord::TestCase assert_deprecated { klass.define_attribute_methods } end + def test_setting_new_attributes_deprecated + t = Topic.new + assert_deprecated { t[:foo] = "bar" } + assert_equal "bar", t.foo + assert_equal "bar", t[:foo] + end + private def cached_columns @cached_columns ||= time_related_columns_on_topic.map(&:name) |