aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dirty_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-14 08:47:42 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-14 08:47:42 -0800
commit848c3d4ea306aa604997b20c11b21c24b931d4eb (patch)
treee1b2a6db52afa89c23462c35bc2917068a536777 /activerecord/test/cases/dirty_test.rb
parentabdff445fbd36e47fb1f3e3b6f49f819f2c37d44 (diff)
parentbdb6c4ef86b814c7380600f3e01e149b718408c9 (diff)
downloadrails-848c3d4ea306aa604997b20c11b21c24b931d4eb.tar.gz
rails-848c3d4ea306aa604997b20c11b21c24b931d4eb.tar.bz2
rails-848c3d4ea306aa604997b20c11b21c24b931d4eb.zip
Merge pull request #3544 from amatsuda/_field_changed
Rename field_changed? to _field_changed? so that users can create a field named field
Diffstat (limited to 'activerecord/test/cases/dirty_test.rb')
-rw-r--r--activerecord/test/cases/dirty_test.rb14
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?