diff options
author | Akira Matsuda <ronnie@dio.jp> | 2011-11-08 10:32:49 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2012-02-14 17:14:22 +0900 |
commit | bdb6c4ef86b814c7380600f3e01e149b718408c9 (patch) | |
tree | 69fd8b973ef0edd8597eb1a711679fa4fb2d6f71 /activerecord | |
parent | 0bd44f91591767ed2da213cae088fda71ab1b14f (diff) | |
download | rails-bdb6c4ef86b814c7380600f3e01e149b718408c9.tar.gz rails-bdb6c4ef86b814c7380600f3e01e149b718408c9.tar.bz2 rails-bdb6c4ef86b814c7380600f3e01e149b718408c9.zip |
A test case for GH #3544 to ensure that a field named field works fine
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/dirty_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb index b1ce846218..54e0b40b4f 100644 --- a/activerecord/test/cases/dirty_test.rb +++ b/activerecord/test/cases/dirty_test.rb @@ -497,6 +497,20 @@ class DirtyTest < ActiveRecord::TestCase assert !pirate.previous_changes.key?('created_on') end + if ActiveRecord::Base.connection.supports_migrations? + class Testings < ActiveRecord::Base; end + def test_field_named_field + ActiveRecord::Base.connection.create_table :testings do |t| + t.string :field + end + assert_nothing_raised do + Testings.new.attributes + end + ensure + ActiveRecord::Base.connection.drop_table :testings rescue nil + end + end + private def with_partial_updates(klass, on = true) old = klass.partial_updates? |