1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Syntax cleanup: for in => each

This commit is contained in:
Guillermo Iguaran 2011-05-19 22:55:37 -05:00
parent 0afd5850f5
commit e7d600dcdb
3 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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

View file

@ -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