diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-11-11 15:23:37 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-11-11 15:23:40 -0200 |
commit | 894fd288596b005148c3882e6431f6453d198101 (patch) | |
tree | e31487682b149e22e529a30cb8bd9505fae69679 /activerecord/lib | |
parent | ceef719924b566a519465de96bd29344ee4d2fed (diff) | |
download | rails-894fd288596b005148c3882e6431f6453d198101.tar.gz rails-894fd288596b005148c3882e6431f6453d198101.tar.bz2 rails-894fd288596b005148c3882e6431f6453d198101.zip |
Fixed bug in active_record/nested_attributes where an empty string id caused an ActiveRecord::RecordNotFound error. Found by [Ben Tillman]
[#5638 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index aca91c907d..bbce6df98f 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -323,7 +323,7 @@ module ActiveRecord (options[:update_only] || record.id.to_s == attributes['id'].to_s) assign_to_or_mark_for_destruction(record, attributes, options[:allow_destroy]) unless call_reject_if(association_name, attributes) - elsif attributes['id'] + elsif not attributes['id'].blank? raise_nested_attributes_record_not_found(association_name, attributes['id']) elsif !reject_new_record?(association_name, attributes) |