diff options
author | Xavier Noria <fxn@hashref.com> | 2011-05-20 03:19:13 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-05-20 03:19:13 -0700 |
commit | 5b8bc4613c179e92f1887b9f6d80898e6dd7108c (patch) | |
tree | 4b6503500e5fde6279bacb8afd5d5b02fa41848f /activerecord/lib/active_record | |
parent | 54823fe6b93d75a90cd627e3852669b5721fdd1f (diff) | |
parent | 159213001ae1d13d0d3eb7947c0595328ef16945 (diff) | |
download | rails-5b8bc4613c179e92f1887b9f6d80898e6dd7108c.tar.gz rails-5b8bc4613c179e92f1887b9f6d80898e6dd7108c.tar.bz2 rails-5b8bc4613c179e92f1887b9f6d80898e6dd7108c.zip |
Merge pull request #1161 from guilleiguaran/each_syntax_in_activerecord
Syntax cleanup: for in => each on ActiveRecord
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/serialization.rb | 2 |
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 |