diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-22 16:14:46 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-22 16:14:46 -0700 |
commit | a4dd0b3433ef2b839fba632d68d06e3627b5573d (patch) | |
tree | b652f2dae265f53af59433b994a6de32fef871a8 /activerecord | |
parent | 92cb0b8be658eb7e569d0a30c4ef78e093460194 (diff) | |
download | rails-a4dd0b3433ef2b839fba632d68d06e3627b5573d.tar.gz rails-a4dd0b3433ef2b839fba632d68d06e3627b5573d.tar.bz2 rails-a4dd0b3433ef2b839fba632d68d06e3627b5573d.zip |
switch present in favor of empty
Diffstat (limited to 'activerecord')
-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 33611b410c..18519a712b 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -386,7 +386,7 @@ module ActiveRecord association.to_a else attribute_ids = attributes_collection.map {|a| a['id'] || a[:id] }.compact - attribute_ids.present? ? association.all(:conditions => {association.primary_key => attribute_ids}) : [] + attribute_ids.empty? ? [] : association.all(:conditions => {association.primary_key => attribute_ids}) end attributes_collection.each do |attributes| |