Permalink
Browse files

A test case for GH #3544 to ensure that a field named field works fine

  • Loading branch information...
1 parent 0bd44f9 commit bdb6c4ef86b814c7380600f3e01e149b718408c9 @amatsuda amatsuda committed Nov 8, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 activerecord/test/cases/dirty_test.rb
@@ -497,6 +497,20 @@ def test_previous_changes
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?

0 comments on commit bdb6c4e

Please sign in to comment.