rails/activerecord/lib/active_record
Nikita Vasilevsky 529d1f55a8
Raise on foreign_key: being passed as an array in associations
Associations have never allowed nor supported `foreign_key` option
being passed as an Array. This still holds true for Rails 7.1
However with Rails 7.1 supporting composite primary keys it may become
more common for applications to mistakenly pass an array to `foreign_key:`.
This commit adds an exception to raise when `foreign_key:` is passed as
an array.
2023-10-13 17:10:07 +00:00
..
associations Use gender neutral pronoun for author [ci skip] 2023-10-03 21:32:26 +02:00
attribute_methods Hyphenate "database specific" [ci-skip] 2023-10-07 12:02:22 -05:00
coders Avoid "comparison of Gem::Version..." error in Ruby < 3.1 2023-02-23 11:25:45 +00:00
connection_adapters Return back maximum allowed PostgreSQL table name to 63 characters 2023-10-12 20:02:12 +03:00
database_configurations 💅 Several fixes to AR::DatabaseConfigurations docs 2023-05-29 19:10:02 +09:00
encryption Merge pull request #48462 from iamradioactive/remove_additional_query 2023-09-25 13:50:07 +02:00
fixture_set Support fixture associations for composite models 2023-04-14 18:12:18 -04:00
locale
locking Fix decrementing counter caches for parent records using optimistic locking 2023-05-30 02:17:37 +03:00
middleware 🔗 Remove RDoc auto-link from Rails module everywhere 2023-06-23 10:49:30 +09:00
migration Fix reverting rename_table for older migrations 2023-10-07 11:51:25 +03:00
railties Remove connected? check from db_runtime payload 2023-07-10 11:21:59 -04:00
relation Update postgres naming to PostgreSQL 2023-10-10 13:44:20 +05:30
scoping Show generated SQL as comment wihout => in all examples [ci-skip] 2023-02-06 18:38:07 +01:00
tasks rails db:drop now removes -shm and -wal sqlite files (#49436) 2023-10-01 20:03:21 +00:00
type Eagerly cast serialized query attributes 2023-07-13 11:44:33 +02:00
type_caster
validations Fix uniqueness validation to correctly work with expression indexes 2023-10-04 11:18:24 +03:00
aggregations.rb Add more missing headers to Active Record docs [ci-skip] 2023-04-22 11:58:15 +02:00
association_relation.rb Enable Style/EvalWithLocation 2023-01-11 18:46:09 -05:00
associations.rb [ci skip] do not use backticks in docs 2023-09-27 13:22:13 +00:00
asynchronous_queries_tracker.rb Call Executor#wrap around each test 2021-10-28 15:18:29 +02:00
attribute_assignment.rb Remove redundant require: follow #10776 2023-03-15 18:16:51 +09:00
attribute_methods.rb Define alias attribute methods in define_attribute_methods 2023-09-06 20:06:39 +00:00
attributes.rb Add more missing headers to Active Record docs [ci-skip] 2023-04-22 11:58:15 +02:00
autosave_association.rb Infer primary_key: :id on associations with composite primary key models 2023-09-05 12:12:57 -04:00
base.rb Support composite primary key in AR::Base#to_param 2023-08-23 21:53:47 +00:00
callbacks.rb 🔗 Remove RDoc auto-link from Rails module everywhere 2023-06-23 10:49:30 +09:00
connection_adapters.rb Refactor Active Record Schema Cache to not hold a connection 2023-07-13 12:34:13 +02:00
connection_handling.rb Deprecate name argument in remove_connection 2023-07-06 15:55:35 -04:00
core.rb Ensure AR::Core#{slice,values_at} appear in RDoc [ci-skip] 2023-10-07 12:26:14 -05:00
counter_cache.rb Merge pull request #48082 from ybakos/ar_counter_cache_examples 2023-05-09 19:45:04 +03:00
database_configurations.rb 💅 Several fixes to AR::DatabaseConfigurations docs 2023-05-29 19:10:02 +09:00
delegated_type.rb Fix header level for ActiveModel::Naming and DelegatedType 2023-04-22 11:25:27 +02:00
deprecator.rb Add ActiveRecord.deprecator 2022-10-25 14:23:08 -05:00
destroy_association_async_job.rb Add some missing headers to Active Records docs [ci-skip] 2023-04-21 11:09:34 +02:00
disable_joins_association_relation.rb Avoid casting to an integer 2023-02-27 10:49:09 +11:00
dynamic_matchers.rb Standardize nodoc comments 2021-07-29 21:18:07 +00:00
encryption.rb Add a encryption option to support previous data encrypted non-deterministically with a SHA1 hash digest (#48530) 2023-06-25 10:16:22 +02:00
enum.rb Make enums validatable without raising error (#49100) 2023-09-01 15:31:12 -04:00
errors.rb Update activerecord/lib/active_record/errors.rb 2023-07-24 19:31:38 +02:00
explain_registry.rb Eliminate internal uses of PerThreadRegistry and deprecate it 2021-11-22 09:53:16 +01:00
explain_subscriber.rb Fix ActiveRecord's explain for queries starting with comments 2022-02-07 00:47:33 +02:00
explain.rb Move shared database logic to MySQL::DatabaseStatements 2023-05-03 10:11:27 -04:00
fixtures.rb [skip ci] Add composite primary key examples to fixture docs 2023-09-06 11:39:59 -05:00
future_result.rb Revert "Merge pull request #48188 from eileencodes/revert-48069" 2023-05-15 10:38:36 -04:00
gem_version.rb Development of Rails 7.2 starts now 2023-09-27 03:59:11 +00:00
inheritance.rb Improve the documentation for ActiveRecord::Inheritance#base_class 2023-08-23 09:19:40 -04:00
insert_all.rb Allow insert_all/upsert_all to use indexes with columns not in the same order as in :unique_by 2023-04-27 17:55:41 +03:00
integration.rb Support composite primary key in AR::Base#to_param 2023-08-23 21:53:47 +00:00
internal_metadata.rb Make NullInternalMetadata private 2023-10-13 09:25:38 -04:00
legacy_yaml_adapter.rb Remove deprecated support to YAML load ActiveRecord::Base instance in the Rails 4.2 and 4.1 formats 2021-11-17 21:51:35 +00:00
log_subscriber.rb Optimize ActiveRecord::LogSubscriber#query_source_location 2023-08-31 11:56:55 +02:00
marshalling.rb Implement marshal_dump and marshal_load on ActiveRecord::Base 2023-03-28 16:46:14 +02:00
message_pack.rb Add ActiveSupport::MessagePack 2023-04-17 11:56:06 -05:00
migration.rb Development of Rails 7.2 starts now 2023-09-27 03:59:11 +00:00
model_schema.rb Load the model schema when running test in eager load context 2023-10-03 13:20:40 +00:00
nested_attributes.rb Rephrase advice about forms for nested attributes [ci-skip] 2023-10-07 11:55:34 -05:00
no_touching.rb Use IsolatedExecutionState across Active Record 2021-11-19 11:54:11 +01:00
normalization.rb Document any callable can normalize AR attributes 2023-09-17 10:31:49 +02:00
persistence.rb Use id in favor of send(primary_key) 2023-09-27 16:43:54 +00:00
promise.rb Replace async: true parameter by async_* methods 2022-04-14 09:55:24 +02:00
query_cache.rb Reduce allocations of pool_configs 2022-09-08 10:27:15 -04:00
query_logs_formatter.rb Fix Active Record SQLCommenter value encoding 2022-10-24 11:12:18 -04:00
query_logs.rb 🔗 Remove RDoc auto-link from Rails module everywhere 2023-06-23 10:49:30 +09:00
querying.rb Tweak the docs for async_* APIs [ci skip] 2023-09-29 11:19:21 +09:00
railtie.rb Capitalize framework names [ci-skip] 2023-10-07 12:26:26 -05:00
readonly_attributes.rb ReadOnlyAttribute: no need for code generation 2023-01-12 15:52:56 +01:00
reflection.rb Raise on foreign_key: being passed as an array in associations 2023-10-13 17:10:07 +00:00
relation.rb 🔗 Remove RDoc auto-link from Rails module everywhere 2023-06-23 10:49:30 +09:00
result.rb Merge pull request #45783 from shhavel/fix/anonymous_pg_columns_of_different_type_from_json 2023-06-02 08:33:08 +09:00
runtime_registry.rb Fix Active Record :db_runtime metric 2022-09-15 10:43:33 +02:00
sanitization.rb Allow use of backslashes to escape literal colons 2023-07-30 07:55:02 -04:00
schema_dumper.rb Rename back unique keys to unique constraints 2023-09-26 17:52:09 +09:00
schema_migration.rb Mark NullSchemaMigration as :nodoc: 2023-10-13 13:16:36 +00:00
schema.rb Clear metadata tables in tests instead of droping 2023-01-11 02:56:49 +02:00
scoping.rb Avoid using Module#<= in value_for 2022-09-01 12:18:50 -07:00
secure_password.rb Add examples of empty passwords for authenticate by 2022-05-20 23:51:26 +05:30
secure_token.rb Generate secure token only once regardless of on: :initialize or on: :create 2023-09-05 17:43:41 +09:00
serialization.rb Remove override of ActiveModel#attribute_names 2022-03-26 10:31:11 +00:00
signed_id.rb Ensure #signed_id outputs url_safe strings (#49507) 2023-10-06 15:24:37 +02:00
statement_cache.rb Fix binds logging for HomogeneousIn 2021-02-25 20:37:20 -05:00
store.rb Fix tracking previous changes for ActiveRecord::Store accessors with underlying JSON data column 2023-08-07 22:26:45 -04:00
suppressor.rb Add more missing headers to Active Record docs [ci-skip] 2023-04-22 11:58:15 +02:00
table_metadata.rb fix class_name STI 2023-09-01 10:55:28 +02:00
test_databases.rb Convert many ActiveRecord::Base class variable into instance variables 2021-06-10 18:31:33 +02:00
test_fixtures.rb Delay Adapter#check_version to #configure_connection 2023-09-29 08:53:16 +02:00
timestamp.rb Hyphenate "database specific" [ci-skip] 2023-10-07 12:02:22 -05:00
token_for.rb Fix ActiveRecord::TokenFor documentation [ci-skip] 2023-09-10 16:45:56 -05:00
touch_later.rb Improve Rails' Shape friendliness (second pass) 2023-01-17 13:55:49 +01:00
transactions.rb Fixes the documentation of with_transaction_returning_status 2023-07-21 13:07:55 +02:00
translation.rb Replace "overwrite" with "override" [ci-skip] 2022-02-21 11:11:11 -06:00
type_caster.rb
type.rb attribute should not require a connection is established 2021-02-02 15:04:23 +09:00
validations.rb Add docs for Active Record validation with multiple contexts 2023-04-06 16:13:38 +01:00
version.rb Replace all occurrences of '<tt>(\w+::\w+)</tt>' with '+$1+' 2023-05-25 06:52:32 +09:00