1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/active_record/associations
Ryuta Kamizono 947a5de75d Don't use explicit references for join aliases
As the API doc shows, `references` should be given table names.

https://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-references

However, people (and test cases in the our codebase) sometimes give
association names for `references`.

Since the API example and all test cases in the codebase use symbols as
arguments, so I regarded symbols as user given values in #40106.

But as #40743 indicates, people also use string association names, it
would have unexpected side-effect especially if singular association
names given.

As much as possible to avoid to use user given values, mark internal
references for `where` and use only them for join aliases.

Fixes #40743.
2020-12-04 15:19:20 +09:00
..
builder Inline constructable checking for singular associations 2020-11-21 17:39:50 +09:00
join_dependency Merge pull request #39999 from kamipo/fix_eager_loading_with_explicit_non_select 2020-08-17 14:34:32 +09:00
preloader Fix preloader to associate preloaded records by default 2020-08-16 07:52:13 +09:00
alias_tracker.rb Allow where references association names as joined table alias names 2020-08-26 10:07:13 +09:00
association.rb Fix inversable associations when they are self-referencing 2020-11-11 20:22:34 +00:00
association_scope.rb Don't use arel factory methods for creating join nodes 2020-08-07 03:57:34 +09:00
belongs_to_association.rb Every foreign_key column is supposed to be a public method 2020-10-02 21:53:56 +09:00
belongs_to_polymorphic_association.rb Add methods to the public API of ActiveRecord::Inheritance 2019-10-17 16:56:07 -04:00
collection_association.rb fix boolean negation in documentation 2020-10-21 22:13:39 +03:00
collection_proxy.rb doc fix: Just referencing an association does not indeed load the records 2020-11-26 01:54:10 +09:00
foreign_association.rb Move set_owner_attributes into ForeignAssociation 2020-06-21 08:12:55 +09:00
has_many_association.rb Every primary_key column is supposed to be a public method 2020-10-02 21:51:10 +09:00
has_many_through_association.rb Implicit scoping does no longer leak scope to class level querying methods 2020-10-30 00:25:38 +00:00
has_one_association.rb Every primary_key column is supposed to be a public method 2020-10-02 21:51:10 +09:00
has_one_through_association.rb Don't expose SingularAssociation#replace which is internal API 2018-05-16 06:43:52 +09:00
join_dependency.rb Don't use explicit references for join aliases 2020-12-04 15:19:20 +09:00
preloader.rb Fix preloader to associate preloaded records by default 2020-08-16 07:52:13 +09:00
singular_association.rb Make the method signature of association.build the same as klass.build and relation.build 2019-10-20 02:51:59 +09:00
through_association.rb Fix through association with source/through scope which has joins 2020-05-22 04:05:27 +09:00