aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2011-05-19 22:55:37 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2011-05-19 22:55:37 -0500
commite7d600dcdb153b9a5c9dbbe733b7dbad74a5274f (patch)
tree4e2ac99ff795d6379142360e8f8b6bbff51e05ab /activerecord/lib/active_record
parent0afd5850f5bba4bd3f1218e27a4a1488c9fdb83e (diff)
downloadrails-e7d600dcdb153b9a5c9dbbe733b7dbad74a5274f.tar.gz
rails-e7d600dcdb153b9a5c9dbbe733b7dbad74a5274f.tar.bz2
rails-e7d600dcdb153b9a5c9dbbe733b7dbad74a5274f.zip
Syntax cleanup: for in => each
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/base.rb2
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb2
-rw-r--r--activerecord/lib/active_record/serialization.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index cd16b8d3ca..30e2d1a82c 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2018,7 +2018,7 @@ MSG
def extract_callstack_for_multiparameter_attributes(pairs)
attributes = { }
- for pair in pairs
+ pairs.each do |pair|
multiparameter_name, value = pair
attribute_name = multiparameter_name.split("(").first
attributes[attribute_name] = {} unless attributes.include?(attribute_name)
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 32d1cff6c3..475e4338ca 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -226,7 +226,7 @@ module ActiveRecord
end
def apply_join_dependency(relation, join_dependency)
- for association in join_dependency.join_associations
+ join_dependency.join_associations.each do |association|
relation = association.join_relation(relation)
end
diff --git a/activerecord/lib/active_record/serialization.rb b/activerecord/lib/active_record/serialization.rb
index 2bde06f562..be4354ce6a 100644
--- a/activerecord/lib/active_record/serialization.rb
+++ b/activerecord/lib/active_record/serialization.rb
@@ -37,7 +37,7 @@ module ActiveRecord #:nodoc:
include_has_options = include_associations.is_a?(Hash)
associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)
- for association in associations
+ associations.each do |association|
records = case self.class.reflect_on_association(association).macro
when :has_many, :has_and_belongs_to_many
send(association).to_a