diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 19:03:51 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 19:03:51 -0700 |
commit | 4292f6051d215bcd77e927144c881fc82d1be049 (patch) | |
tree | 67a02740d4fe14bb6bff8e9717e1ff46cee48d14 /activerecord/lib/active_record | |
parent | d0e36c6b85acf4773e0a88c83b1b4aedeb5b7a39 (diff) | |
download | rails-4292f6051d215bcd77e927144c881fc82d1be049.tar.gz rails-4292f6051d215bcd77e927144c881fc82d1be049.tar.bz2 rails-4292f6051d215bcd77e927144c881fc82d1be049.zip |
we do not need to to_s the name all the time
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 15e0053d6d..f4bbdc7092 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -233,7 +233,7 @@ module ActiveRecord end def construct(parent, nodes, row, rs) - nodes.sort_by { |k| k.name.to_s }.each do |node| + nodes.sort_by { |k| k.name }.each do |node| association_name = node.name assoc = node.children association = construct_scalar(parent, association_name, row, rs, nodes) @@ -241,10 +241,8 @@ module ActiveRecord end end - def construct_scalar(parent, associations, row, rs, nodes) - name = associations.to_s - - node = nodes.detect { |j| j.name.to_s == name } + def construct_scalar(parent, name, row, rs, nodes) + node = nodes.detect { |j| j.name == name } raise(ConfigurationError, "No such association") unless node |