diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-02-27 13:50:24 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-02-27 13:50:24 +0100 |
commit | 5cda000bf0f6d85d1a1efedf9fa4d0b6eaf988a1 (patch) | |
tree | f69b9e1037c5e27d4a13add5b91fd9b59c88d5c4 /activerecord/lib/active_record/associations/has_many_through_association.rb | |
parent | dec91a2e0655d288bd5184c981e2f4c60d9b3cf1 (diff) | |
download | rails-5cda000bf0f6d85d1a1efedf9fa4d0b6eaf988a1.tar.gz rails-5cda000bf0f6d85d1a1efedf9fa4d0b6eaf988a1.tar.bz2 rails-5cda000bf0f6d85d1a1efedf9fa4d0b6eaf988a1.zip |
Fixed that autosave should validate associations even if master is invalid [#1930 status:committed]
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 2eeeb28d1f..d5d188ac2a 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -47,12 +47,12 @@ module ActiveRecord options[:include] = @reflection.source_reflection.options[:include] if options[:include].nil? end - def insert_record(record, force=true) + def insert_record(record, force = true, validate = true) if record.new_record? if force record.save! else - return false unless record.save + return false unless record.save(validate) end end through_reflection = @reflection.through_reflection |