Permalink
Browse files

Revert "Ensure that save on child object fails for invalid belongs_to…

… association. Closes #11555. [rubyruy]"

This reverts commit c67e985.
  • Loading branch information...
NZKoz committed Apr 11, 2008
1 parent ed99dda commit 2e74177d0b61f872b773285471ff9025f0eaa96c
View
@@ -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 @@ def belongs_to(association_id, options = {})
)
end
- add_single_associated_save_callbacks(reflection.name)
-
configure_dependency_for_belongs_to(reflection)
end
@@ -377,16 +377,4 @@ def test_cant_save_readonly_association
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

4 comments on commit 2e74177

@mislav

This comment has been minimized.

Show comment Hide comment
@mislav

mislav Apr 11, 2008

Member

Shouldn’t we add a test that discovered the issue and lead to this revert?

Member

mislav replied Apr 11, 2008

Shouldn’t we add a test that discovered the issue and lead to this revert?

@lifo

This comment has been minimized.

Show comment Hide comment
@lifo

lifo Apr 11, 2008

Member

http://groups.google.com/group/rubyonrails-core/browse_thread/thread/652d0d7e6d455c08 should explain it.

Member

lifo replied Apr 11, 2008

http://groups.google.com/group/rubyonrails-core/browse_thread/thread/652d0d7e6d455c08 should explain it.

@lifo

This comment has been minimized.

Show comment Hide comment
@lifo

lifo Apr 11, 2008

Member

But yeah, we need to add a test

Member

lifo replied Apr 11, 2008

But yeah, we need to add a test

@mislav

This comment has been minimized.

Show comment Hide comment
@mislav

mislav Apr 11, 2008

Member

haha :)
but seriously, lifo is cool

Member

mislav replied Apr 11, 2008

haha :)
but seriously, lifo is cool

Please sign in to comment.