diff options
author | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-29 07:22:42 -0500 |
---|---|---|
committer | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-29 07:22:42 -0500 |
commit | 2e8c8d60e7568f9fb82fbed26d86c45d3cf82232 (patch) | |
tree | 908fcb1c16474887a4f49985754b1be4e20c603f /activerecord/lib/active_record/associations/preloader | |
parent | bee764965e80b0f4f0a15c31b340f245779a7d89 (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/association.rb | 4 |
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) |