mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
Merge branch 'master' of git@github.com:rails/rails
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
* Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick]
|
||||
|
||||
* Ensure that save on child object fails for invalid belongs_to association. Closes #11555. [rubyruy]
|
||||
|
||||
* Add support for interleaving migrations by storing which migrations have run in the new schema_migrations table. Closes #11493 [jordi]
|
||||
|
||||
* ActiveRecord::Base#sum defaults to 0 if no rows are returned. Closes #11550 [kamal]
|
||||
|
||||
@@ -922,8 +922,6 @@ module ActiveRecord
|
||||
)
|
||||
end
|
||||
|
||||
add_single_associated_save_callbacks(reflection.name)
|
||||
|
||||
configure_dependency_for_belongs_to(reflection)
|
||||
end
|
||||
|
||||
|
||||
@@ -377,16 +377,4 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
|
||||
assert companies(:first_client).readonly_firm.readonly?
|
||||
end
|
||||
|
||||
def test_save_fails_for_invalid_belongs_to
|
||||
log = AuditLog.new
|
||||
assert log.valid?
|
||||
|
||||
log.build_developer # Build invalid association
|
||||
assert !log.developer.valid?
|
||||
assert !log.valid?
|
||||
assert_equal "is invalid", log.errors.on("developer")
|
||||
|
||||
assert !log.save
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user