Skip to content

Commit

Permalink
A test case for GH #3544 to ensure that a field named field works fine
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Feb 14, 2012
1 parent 0bd44f9 commit bdb6c4e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions activerecord/test/cases/dirty_test.rb
Expand Up @@ -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?
Expand Down

0 comments on commit bdb6c4e

Please sign in to comment.