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
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
..
associations Don't use explicit references for join aliases 2020-12-04 15:19:20 +09:00
attribute_methods Unify decorate_attribute_type and attribute 2020-11-30 15:51:19 -06:00
coders Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops 2020-05-24 12:51:35 +03:00
connection_adapters Merge pull request #40651 from ritikesh/create_table_schema_bugfix 2020-11-19 23:39:35 +09:00
database_configurations Address to false negative for Performance/DeletePrefix,DeleteSuffix 2020-06-14 13:04:47 +09:00
fixture_set Use join_foreign_key rather than self constructed key name 2020-07-03 18:58:44 +09:00
locale
locking Use attribute_before_type_cast in the internal 2020-10-27 16:38:32 +09:00
middleware Make AR::Middleware::DatabaseSelector loadable without full core ext 2020-06-09 19:43:50 +09:00
migration Start Rails 6.2 development 🎉 2020-12-03 01:35:29 +00:00
railties Add db:structure:load_if_sql and db:schema:load_if_ruby back 2020-11-24 22:09:48 +00:00
relation Don't use explicit references for join aliases 2020-12-04 15:19:20 +09:00
scoping Add option for default_scope to run on all queries 2020-12-01 11:15:08 -05:00
tasks Add option to mute multiple database yaml warning 2020-10-29 16:57:57 -04:00
type Handle frozen payloads in AR::Type::Serialized 2020-10-20 09:32:21 +02:00
type_caster Use Arel::Table#type_for_attribute 2020-06-03 06:30:22 +09:00
validations MySQL: Uniqueness validator now respects default database collation 2020-10-30 00:25:46 +00:00
aggregations.rb
association_relation.rb Implicit scoping does no longer leak scope to class level querying methods 2020-10-30 00:25:38 +00:00
associations.rb Destroy associations in a background job. 2020-09-24 14:24:15 -04:00
attribute_assignment.rb More less and lazy allocation for assign_attributes and _assign_attributes 2020-02-25 16:58:00 +09:00
attribute_methods.rb Make sure that attribute_for_inspect respect filter_attributes 2020-12-02 23:01:34 +00:00
attributes.rb Unify decorate_attribute_type and attribute 2020-11-30 15:51:19 -06:00
autosave_association.rb Set inverse during has one autosave if necessary 2020-10-30 15:31:40 +00:00
base.rb Remove internal attribute decoration code 2020-07-20 13:26:25 +09:00
callbacks.rb Document metaprogrammed Active Record callbacks [ci-skip] 2020-11-06 21:22:07 -06:00
connection_adapters.rb Implement granular role and shard swapping 2020-10-28 15:11:35 -04:00
connection_handling.rb Fix connected_to_many argument and docs 2020-11-03 17:19:28 -05:00
core.rb Make sure that attribute_for_inspect respect filter_attributes 2020-12-02 23:01:34 +00:00
counter_cache.rb touch_attributes_with_time takes keyword arguments 2020-04-17 18:55:58 +09:00
database_configurations.rb Update database_configurations.rb output message 2020-11-04 18:00:09 -08:00
delegated_type.rb Fix typo s/delegates/delegate/ [ci skip] 2020-07-10 16:01:15 +09:00
destroy_association_async_job.rb Destroy associations in a background job. 2020-09-24 14:24:15 -04:00
dynamic_matchers.rb
enum.rb Unify decorate_attribute_type and attribute 2020-11-30 15:51:19 -06:00
errors.rb Remove deprecated support for using unsafe raw SQL in ActiveRecord::Relation methods 2020-10-30 00:25:32 +00:00
explain.rb Should not substitute binds when prepared_statements: true 2020-05-10 21:59:27 +09:00
explain_registry.rb
explain_subscriber.rb
fixtures.rb Add ActionText::FixtureSet.attachment 2020-10-30 15:53:35 -04:00
gem_version.rb Start Rails 6.2 development 🎉 2020-12-03 01:35:29 +00:00
inheritance.rb Support storing demodulized class name for polymorphic type 2020-08-23 16:04:29 +09:00
insert_all.rb Don't over protect the MySQL users on insert_all 2020-11-04 20:26:22 +00:00
integration.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
internal_metadata.rb Eagerly define attribute methods for internal models 2020-11-06 23:46:16 +00:00
legacy_yaml_adapter.rb Deprecate YAML loading from legacy format older than Rails 5.0 2020-06-15 15:03:45 +09:00
log_subscriber.rb Allow applications to change the behavior for a strict loading violation 2020-11-02 13:01:50 -05:00
migration.rb Show outstanding migrations when the PendingMigration error is raised. This will give users feedback on which migration is outstanding. 2020-10-26 20:54:49 +00:00
model_schema.rb Fix documentation [ci skip] 2020-11-03 19:32:16 +00:00
nested_attributes.rb Fix: on accessing the parent record before creation with has_many_inversing adds two records to association 2020-02-20 09:26:47 +01:00
no_touching.rb
null_relation.rb
persistence.rb Add option for default_scope to run on all queries 2020-12-01 11:15:08 -05:00
query_cache.rb Implement granular role and shard swapping 2020-10-28 15:11:35 -04:00
querying.rb Support relation.and for intersection as Set theory 2020-06-07 11:25:51 +09:00
railtie.rb Fix typos [ci skip] 2020-11-09 15:23:39 +09:00
readonly_attributes.rb
reflection.rb Remove useless VALID_AUTOMATIC_INVERSE_MACROS checking 2020-11-25 16:13:59 +09:00
relation.rb Implicit scoping does no longer leak scope to class level querying methods 2020-10-30 00:25:38 +00:00
result.rb Remove deprecated ActiveRecord::Result#to_hash method 2020-10-30 00:25:33 +00:00
runtime_registry.rb Get rid of the unused RuntimeRegistry.connection_handler 2020-08-05 14:16:56 +02:00
sanitization.rb Remove deprecated support for using unsafe raw SQL in ActiveRecord::Relation methods 2020-10-30 00:25:32 +00:00
schema.rb
schema_dumper.rb Add basic support for check constraints to database migrations 2020-06-02 22:11:27 -07:00
schema_migration.rb Eagerly define attribute methods for internal models 2020-11-06 23:46:16 +00:00
scoping.rb
secure_token.rb
serialization.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
signed_id.rb Fix AR signed IDs for STI models 2020-09-06 20:00:02 -04:00
statement_cache.rb Fix CI failure when prepared_statements: false 2020-06-25 02:12:35 +09:00
store.rb Attribute reader / writer methods are defined as public methods 2020-10-02 22:23:38 +09:00
suppressor.rb save and save! doesn't take positional arguments 2020-05-05 16:51:21 +09:00
table_metadata.rb Fix where with has_many through *belongs_to* association 2020-11-22 11:53:47 +09:00
test_databases.rb
test_fixtures.rb Share connection pools for non-default shards 2020-10-29 22:52:23 +00:00
timestamp.rb Restore attribute alias resolution for attribute_{for_inspect,present?} 2020-06-14 10:34:38 +09:00
touch_later.rb Ensure alias resolved before clear_attribute_changes 2020-06-04 12:02:28 +09:00
transactions.rb Remove sync_with_transaction_state to simplify code base 2020-05-17 20:57:32 +09:00
translation.rb
type.rb Add a setting to specify that all string columns should be immutable 2020-06-11 15:07:06 +09:00
type_caster.rb
validations.rb
version.rb