From d4c9a8f7dba49f8bb181097fcd8e1ca8bf5e198f Mon Sep 17 00:00:00 2001 From: Tim Assmann Date: Fri, 9 Oct 2009 18:07:29 +0200 Subject: [PATCH] active_record accept_nested_attributes_for makes the relation autosave and auto-validate by default, before was only autosave --- .../lib/active_record/nested_attributes.rb | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index acd0b9c..b4324a8 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -229,6 +229,8 @@ module ActiveRecord end reflection.options[:autosave] = true + reflection.options[:validate] = true + self.nested_attributes_options[association_name.to_sym] = options # def pirate_attributes=(attributes) -- 1.5.5