diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 20:32:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 20:32:11 -0700 |
commit | 9b1a4fda6fa8c98fff7ee3d4e781e90cae01a98c (patch) | |
tree | 7ebe58a840c301e83fb81122eb418d1a2dddf679 /activerecord | |
parent | 27be777888cfefc6667c1d3b4c284cf1d0b67208 (diff) | |
download | rails-9b1a4fda6fa8c98fff7ee3d4e781e90cae01a98c.tar.gz rails-9b1a4fda6fa8c98fff7ee3d4e781e90cae01a98c.tar.bz2 rails-9b1a4fda6fa8c98fff7ee3d4e781e90cae01a98c.zip |
fix case / when indentation
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 1af661c14f..acc5bac1ad 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1951,27 +1951,27 @@ module ActiveRecord def construct(parent, associations, joins, row) case associations - when Symbol, String - join = joins.detect{|j| j.reflection.name.to_s == associations.to_s && j.parent_table_name == parent.class.table_name } + when Symbol, String + join = joins.detect{|j| j.reflection.name.to_s == associations.to_s && j.parent_table_name == parent.class.table_name } + raise(ConfigurationError, "No such association") if join.nil? + + joins.delete(join) + construct_association(parent, join, row) + when Array + associations.each do |association| + construct(parent, association, joins, row) + end + when Hash + associations.sort_by { |k,_| k.to_s }.each do |name, assoc| + join = joins.detect{|j| j.reflection.name.to_s == name.to_s && j.parent_table_name == parent.class.table_name } raise(ConfigurationError, "No such association") if join.nil? + association = construct_association(parent, join, row) joins.delete(join) - construct_association(parent, join, row) - when Array - associations.each do |association| - construct(parent, association, joins, row) - end - when Hash - associations.sort_by { |k,_| k.to_s }.each do |name, assoc| - join = joins.detect{|j| j.reflection.name.to_s == name.to_s && j.parent_table_name == parent.class.table_name } - raise(ConfigurationError, "No such association") if join.nil? - - association = construct_association(parent, join, row) - joins.delete(join) - construct(association, assoc, joins, row) if association - end - else - raise ConfigurationError, associations.inspect + construct(association, assoc, joins, row) if association + end + else + raise ConfigurationError, associations.inspect end end |