aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-04-11 16:04:11 +1200
committerMichael Koziarski <michael@koziarski.com>2008-04-11 16:04:11 +1200
commit2e74177d0b61f872b773285471ff9025f0eaa96c (patch)
treefd87aba4296290394e536ee0549aa33d8a19fe78
parented99dda174da439a0947cdabea3babf027c672ac (diff)
downloadrails-2e74177d0b61f872b773285471ff9025f0eaa96c.tar.gz
rails-2e74177d0b61f872b773285471ff9025f0eaa96c.tar.bz2
rails-2e74177d0b61f872b773285471ff9025f0eaa96c.zip
Revert "Ensure that save on child object fails for invalid belongs_to association. Closes #11555. [rubyruy]"
This reverts commit c67e985994362290308073ed2793dd8e7f2a76db.
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/associations.rb2
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb12
3 files changed, 0 insertions, 16 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index e79487c687..3248594c19 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -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]
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 3ea933875d..7d27b0607a 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -922,8 +922,6 @@ module ActiveRecord
)
end
- add_single_associated_save_callbacks(reflection.name)
-
configure_dependency_for_belongs_to(reflection)
end
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 75f236aca0..b8ec9117af 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -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