aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/preloader/association.rb
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-01-29 07:22:42 -0500
committerDaniel Colson <danieljamescolson@gmail.com>2018-01-29 07:22:42 -0500
commit2e8c8d60e7568f9fb82fbed26d86c45d3cf82232 (patch)
tree908fcb1c16474887a4f49985754b1be4e20c603f /activerecord/lib/active_record/associations/preloader/association.rb
parentbee764965e80b0f4f0a15c31b340f245779a7d89 (diff)
downloadrails-2e8c8d60e7568f9fb82fbed26d86c45d3cf82232.tar.gz
rails-2e8c8d60e7568f9fb82fbed26d86c45d3cf82232.tar.bz2
rails-2e8c8d60e7568f9fb82fbed26d86c45d3cf82232.zip
Avoid extra calls to to_s
With #31615 `type_for_attribute` accepts either a symbol as well as a string. `has_attribute?` and `attribute_alias` also accept either. Since these methods call `to_s` on the argument, we no longer need to do that at the call site.
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader/association.rb')
-rw-r--r--activerecord/lib/active_record/associations/preloader/association.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb
index 735da152b7..ec6f0df484 100644
--- a/activerecord/lib/active_record/associations/preloader/association.rb
+++ b/activerecord/lib/active_record/associations/preloader/association.rb
@@ -82,11 +82,11 @@ module ActiveRecord
end
def association_key_type
- @klass.type_for_attribute(association_key_name.to_s).type
+ @klass.type_for_attribute(association_key_name).type
end
def owner_key_type
- @model.type_for_attribute(owner_key_name.to_s).type
+ @model.type_for_attribute(owner_key_name).type
end
def load_records(&block)