Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Syntax cleanup: for in => each

  • Loading branch information...
commit e7d600dcdb153b9a5c9dbbe733b7dbad74a5274f 1 parent 0afd585
@guilleiguaran guilleiguaran authored
View
2  activerecord/lib/active_record/base.rb
@@ -2018,7 +2018,7 @@ def extract_max_param_for_multiparameter_attributes(values_hash_from_param, uppe
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)
View
2  activerecord/lib/active_record/relation/finder_methods.rb
@@ -226,7 +226,7 @@ def construct_relation_for_association_find(join_dependency)
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
View
2  activerecord/lib/active_record/serialization.rb
@@ -37,7 +37,7 @@ def serializable_add_includes(options = {})
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
Please sign in to comment.
Something went wrong with that request. Please try again.