aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 10:04:37 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 10:04:37 +0000
commitc0e618cf6f7f6c4a474e4ed30e05c16620615b9a (patch)
tree23480589b45d58dcfe3c2b9ab5e02af6a05056a1 /activerecord/lib/active_record/associations.rb
parent57070277b420819b9bf0980e1a794a587f31dff6 (diff)
downloadrails-c0e618cf6f7f6c4a474e4ed30e05c16620615b9a.tar.gz
rails-c0e618cf6f7f6c4a474e4ed30e05c16620615b9a.tar.bz2
rails-c0e618cf6f7f6c4a474e4ed30e05c16620615b9a.zip
Refactored to a more readble form #1813
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2202 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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