Permalink
Browse files

Merge pull request #8895 from ernie/revert-hmt-on-unsaved-in-3-2

Revert hm:t on unsaved collection for 3.2
  • Loading branch information...
2 parents 3211eb1 + 18b9187 commit 2c5e0adefeb1541cfc887a876d9e96329a70537d @rafaelfranca rafaelfranca committed Jan 11, 2013
@@ -1,5 +1,11 @@
## Rails 3.2.12 (unreleased) ##
+* Revert creation of through association models when using `collection=[]`
+ on a `has_many :through` association from an unsaved model.
+ Fix #7661, #8269.
+
+ *Ernie Miller*
+
* Fix undefined method `to_i` when calling `new` on a scope that uses an
Array; Fix FloatDomainError when setting integer column to NaN.
Fixes #8718, #8734, #8757.
@@ -38,20 +38,6 @@ def concat(*records)
super
end
- def concat_records(records)
- ensure_not_nested
-
- records = super
-
- if owner.new_record? && records
- records.flatten.each do |record|
- build_through_record(record)
- end
- end
-
- records
- end
-
def insert_record(record, validate = true, raise = false)
ensure_not_nested
@@ -851,11 +851,6 @@ def test_save_should_not_raise_exception_when_join_record_has_errors
end
end
- def test_assign_array_to_new_record_builds_join_records
- c = Category.new(:name => 'Fishing', :authors => [Author.first])
- assert_equal 1, c.categorizations.size
- end
-
def test_create_bang_should_raise_exception_when_join_record_has_errors
repair_validations(Categorization) do
Categorization.validate { |r| r.errors[:base] << 'Invalid Categorization' }

0 comments on commit 2c5e0ad

Please sign in to comment.