aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index df9c66aa08..bfa932c5b8 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -692,9 +692,7 @@ module ActiveRecord
else
records_to_save = association.select{ |record| record.new_record? }
end
- records_to_save.inject(true) do |result,record|
- result &&= record.valid?
- end
+ records_to_save.all? { |record| record.valid? }
end
end_eval
end