aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorYasuo Honda <yasuo.honda@gmail.com>2016-08-11 11:26:20 +0000
committerYasuo Honda <yasuo.honda@gmail.com>2016-08-11 15:38:40 +0000
commitbe9dc78fccc80bb5045c67b435b5c7e36ea8a296 (patch)
tree8e3d12dddf848166ad37f8ec66aaa3965b1cee90 /activerecord
parentb9f71e49ae43c53258da95bda50325a8d0c99a52 (diff)
downloadrails-be9dc78fccc80bb5045c67b435b5c7e36ea8a296.tar.gz
rails-be9dc78fccc80bb5045c67b435b5c7e36ea8a296.tar.bz2
rails-be9dc78fccc80bb5045c67b435b5c7e36ea8a296.zip
Creating a new Topic class instead of class_eval for the existing one
since it affects another test `ReflectionTest#test_read_attribute_names` Address #26099
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/validations_test.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb
index 76510cb80d..5d9aa99497 100644
--- a/activerecord/test/cases/validations_test.rb
+++ b/activerecord/test/cases/validations_test.rb
@@ -156,17 +156,15 @@ class ValidationsTest < ActiveRecord::TestCase
end
def test_numericality_validation_with_mutation
- Topic.class_eval do
+ klass = Class.new(Topic) do
attribute :wibble, :string
validates_numericality_of :wibble, only_integer: true
end
- topic = Topic.new(wibble: "123-4567")
+ topic = klass.new(wibble: "123-4567")
topic.wibble.gsub!("-", "")
assert topic.valid?
- ensure
- Topic.reset_column_information
end
def test_acceptance_validator_doesnt_require_db_connection