Skip to content
This repository
Browse code

Syntax cleanup: for in => each

  • Loading branch information...
commit e7d600dcdb153b9a5c9dbbe733b7dbad74a5274f 1 parent 0afd585
Guillermo Iguaran authored May 19, 2011
2  activerecord/lib/active_record/base.rb
@@ -2018,7 +2018,7 @@ def extract_max_param_for_multiparameter_attributes(values_hash_from_param, uppe
2018 2018
       def extract_callstack_for_multiparameter_attributes(pairs)
2019 2019
         attributes = { }
2020 2020
 
2021  
-        for pair in pairs
  2021
+        pairs.each do |pair|
2022 2022
           multiparameter_name, value = pair
2023 2023
           attribute_name = multiparameter_name.split("(").first
2024 2024
           attributes[attribute_name] = {} unless attributes.include?(attribute_name)
2  activerecord/lib/active_record/relation/finder_methods.rb
@@ -226,7 +226,7 @@ def construct_relation_for_association_find(join_dependency)
226 226
     end
227 227
 
228 228
     def apply_join_dependency(relation, join_dependency)
229  
-      for association in join_dependency.join_associations
  229
+      join_dependency.join_associations.each do |association|
230 230
         relation = association.join_relation(relation)
231 231
       end
232 232
 
2  activerecord/lib/active_record/serialization.rb
@@ -37,7 +37,7 @@ def serializable_add_includes(options = {})
37 37
         include_has_options = include_associations.is_a?(Hash)
38 38
         associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)
39 39
 
40  
-        for association in associations
  40
+        associations.each do |association|
41 41
           records = case self.class.reflect_on_association(association).macro
42 42
           when :has_many, :has_and_belongs_to_many
43 43
             send(association).to_a

0 notes on commit e7d600d

Please sign in to comment.
Something went wrong with that request. Please try again.