mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
parent
fb99a48b06
commit
b6c0bc9c8a
2 changed files with 8 additions and 1 deletions
|
@ -65,7 +65,7 @@ module ActiveRecord
|
|||
|
||||
def with_value_from_user(value)
|
||||
type.assert_valid_value(value)
|
||||
self.class.from_user(name, value, type, self)
|
||||
self.class.from_user(name, value, type, original_attribute || self)
|
||||
end
|
||||
|
||||
def with_value_from_database(value)
|
||||
|
|
|
@ -115,6 +115,13 @@ class BasicsTest < ActiveRecord::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_many_mutations
|
||||
car = Car.new name: "<3<3<3"
|
||||
car.engines_count = 0
|
||||
20_000.times { car.engines_count += 1 }
|
||||
assert car.save
|
||||
end
|
||||
|
||||
def test_limit_without_comma
|
||||
assert_equal 1, Topic.limit("1").to_a.length
|
||||
assert_equal 1, Topic.limit(1).to_a.length
|
||||
|
|
Loading…
Reference in a new issue