We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 530d3f7 + be9dc78 commit be68f18Copy full SHA for be68f18
activerecord/test/cases/validations_test.rb
@@ -156,17 +156,15 @@ def test_validators
156
end
157
158
def test_numericality_validation_with_mutation
159
- Topic.class_eval do
+ klass = Class.new(Topic) do
160
attribute :wibble, :string
161
validates_numericality_of :wibble, only_integer: true
162
163
164
- topic = Topic.new(wibble: "123-4567")
+ topic = klass.new(wibble: "123-4567")
165
topic.wibble.gsub!("-", "")
166
167
assert topic.valid?
168
- ensure
169
- Topic.reset_column_information
170
171
172
def test_acceptance_validator_doesnt_require_db_connection
0 commit comments