diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-31 22:05:23 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-01-01 04:31:23 +0900 |
commit | 2955ee4198a17c94e0b3429200c7b171820eef25 (patch) | |
tree | 6ed39f0b9c3988740327c155f5ff40e219495506 /activerecord/lib/active_record/relation | |
parent | 15b3275a291d3d9bdf4db3f054b2283788396af3 (diff) | |
download | rails-2955ee4198a17c94e0b3429200c7b171820eef25.tar.gz rails-2955ee4198a17c94e0b3429200c7b171820eef25.tar.bz2 rails-2955ee4198a17c94e0b3429200c7b171820eef25.zip |
Refactor delegating `join_primary_key` instead of `join_keys` and `association_primary_key` in `TableMetadata`
Because `join_primary_key` is called by `join_keys` and it is to
abstract calling `association_primary_key`.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb b/activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb index 0255a65bfe..28c7483c95 100644 --- a/activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb +++ b/activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb @@ -30,7 +30,7 @@ module ActiveRecord end def primary_key - associated_table.association_join_keys.key + associated_table.association_join_primary_key end def convert_to_id(value) diff --git a/activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb b/activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb index b87b5c36dd..e8e2f2c626 100644 --- a/activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb +++ b/activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb @@ -29,7 +29,7 @@ module ActiveRecord end def primary_key(value) - associated_table.association_primary_key(base_class(value)) + associated_table.association_join_primary_key(base_class(value)) end def base_class(value) |