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
eileencodes 7b4fdf3ce7
Remove assumption that a primary config exists
Applications may not have a primary configuration so we should not
assume there is one. In both these cases we can get the right connection
without that.

For the databases.rake file we want to re-establish a connection for the
environment we're in. The first config defined under an environment for
a multi-db app will win. This is already the case on application boot so
we should be consistent.

For the info.rb file we already have a connection so we can lookup the
adapter from the connection's db_config. If a primary hadn't existed
this would have thrown an exception.

Followup to https://github.com/rails/rails/pull/39535 which removed the
assumption there was a primary config from the schema cache load
railtie.

Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
2020-06-04 15:08:59 -04:00
..
associations Merge pull request #39513 from kamipo/ensure_column_names_as_string 2020-06-03 05:19:22 +09:00
attribute_methods Avoid redundant to_s in internal attribute API 2020-06-04 09:02:53 +09:00
coders Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops 2020-05-24 12:51:35 +03:00
connection_adapters Revert "Ivar += in MRI is thread safe" 2020-06-05 00:49:01 +09:00
database_configurations Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops 2020-05-24 12:51:35 +03:00
fixture_set Allow attribute aliases for timestamp magic columns 2020-06-01 21:29:33 +09:00
locale
locking Ensure alias resolved before clear_attribute_changes 2020-06-04 12:02:28 +09:00
middleware Allow updating the database selector context with the response 2020-01-16 19:25:22 +01:00
migration Add basic support for check constraints to database migrations 2020-06-02 22:11:27 -07:00
railties Remove assumption that a primary config exists 2020-06-04 15:08:59 -04:00
relation Ensure column names on reflection as a string 2020-06-03 01:48:24 +09:00
scoping Avoid confliting Kernel-named scopes on Relation 2020-05-12 11:10:39 -07:00
tasks add option in database config for metadata table 2020-04-03 11:48:08 -07:00
type Registration#matches? takes keyword arguments 2019-09-07 11:51:20 +09:00
type_caster Use Arel::Table#type_for_attribute 2020-06-03 06:30:22 +09:00
validations Allow attribute aliases for validates_uniqueness_of 2020-06-01 22:44:39 +09:00
advisory_lock_base.rb Move advisory lock to it's own connection 2020-01-23 14:36:32 -05:00
aggregations.rb Fix docs to replace http with https in activerecord [ci skip] 2019-08-26 22:34:33 +09:00
association_relation.rb Support bulk insert/upsert on relation to preserve scope values 2020-04-25 01:22:54 +09:00
associations.rb Whitespaces 2020-05-20 12:50:44 -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_decorators.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
attribute_methods.rb Avoid redundant to_s in internal attribute API 2020-06-04 09:02:53 +09:00
attributes.rb Use the model's adapter for the attribute type lookup 2020-01-16 21:26:08 -05:00
autosave_association.rb Ensure column names on reflection as a string 2020-06-03 01:48:24 +09:00
base.rb Add delegated type to Active Record (#39341) 2020-05-23 15:14:40 -07:00
callbacks.rb Remove ActiveRecord::DefineCallbacks module 2020-04-10 06:46:06 +01:00
connection_adapters.rb Add basic support for check constraints to database migrations 2020-06-02 22:11:27 -07:00
connection_handling.rb Remove owner_name 2020-03-07 09:00:43 -05:00
core.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
counter_cache.rb touch_attributes_with_time takes keyword arguments 2020-04-17 18:55:58 +09:00
database_configurations.rb Remove owner_name 2020-03-07 09:00:43 -05:00
delegated_type.rb [skip-ci] Fix delegated_type examples 2020-05-24 09:20:37 -04:00
dynamic_matchers.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
enum.rb Remove implementation of unchecked_serialize 2020-05-12 13:37:22 -04:00
errors.rb Update some references to finder options [ci skip] 2020-02-24 00:03:53 +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 Use match? where we don't need MatchData 2019-07-27 13:06:49 +09:00
fixtures.rb update global rails commands to bundled rails i.e. bin/rails 2020-04-11 17:32:26 +01:00
gem_version.rb Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
inheritance.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
insert_all.rb Fix issue with expression index in insert_all 2020-06-03 10:10:01 -04:00
integration.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
internal_metadata.rb Apply suggestions from review 2020-04-16 09:00:58 -07:00
legacy_yaml_adapter.rb
log_subscriber.rb Deprecate passing a column to type_cast 2020-05-02 07:18:30 +09:00
migration.rb "core_ext/array" is not used in here, but used in others 2020-05-10 04:10:32 +09:00
model_schema.rb Support attribute aliases for type_for_attribute 2020-06-03 02:42:07 +09: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 Unify AR touch method signatures 2019-09-06 18:52:00 +09:00
null_relation.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
persistence.rb Ensure alias resolved before clear_attribute_changes 2020-06-04 12:02:28 +09:00
query_cache.rb Reduce Array allocations 2019-07-31 17:41:34 +09:00
querying.rb Avoid quite useless loop in find_by_sql 2020-05-01 18:08:44 +09:00
railtie.rb Make signed_id_verifier_secret lazily evaluated 2020-05-28 19:00:41 +01:00
readonly_attributes.rb Extract readonly_attribute? 2019-05-27 06:41:31 +09:00
reflection.rb Merge pull request #39513 from kamipo/ensure_column_names_as_string 2020-06-03 05:19:22 +09:00
relation.rb Merge pull request #39515 from kamipo/type_for_attribute_be_aware_of_attribute_aliases 2020-06-03 10:33:16 +09:00
result.rb Fix pluck to correctly type cast same column names and association columns 2020-05-13 20:24:42 +09:00
runtime_registry.rb
sanitization.rb Extract id_for_database in the AR object 2020-05-31 09:13:29 +09:00
schema.rb Move SchemaMigration to migration_context 2019-06-14 11:15:08 -04:00
schema_dumper.rb Add basic support for check constraints to database migrations 2020-06-02 22:11:27 -07:00
schema_migration.rb Fix keyword arguments warnings 2019-09-09 22:49:09 +09:00
scoping.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
secure_token.rb Set default of 28 characters in ActiveStorage::Blob.generate_unique_secure_token 2019-04-09 19:45:26 -04:00
serialization.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
signed_id.rb Make signed_id_verifier_secret lazily evaluated 2020-05-28 19:00:41 +01:00
statement_cache.rb Add add_binds to bulk binds processing for performance 2020-05-11 03:24:49 +09:00
store.rb [ci skip] switch eg. to proper e.g. 2019-10-07 02:18:36 +02:00
suppressor.rb save and save! doesn't take positional arguments 2020-05-05 16:51:21 +09:00
table_metadata.rb Use Arel::Table#type_for_attribute 2020-06-03 06:30:22 +09:00
test_databases.rb Restore previous behavior of parallel test databases 2020-01-07 16:03:00 -05:00
test_fixtures.rb Fix #39205 ReadOnlyError when on writing connection 2020-05-13 11:23:52 -04:00
timestamp.rb Promote clear_attribute_change as attribute methods 2020-06-04 04:17:17 +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 Use the model's adapter for the attribute type lookup 2020-01-16 21:26:08 -05:00
type_caster.rb
validations.rb Add ActiveRecord::Validations::NumericalityValidator 2020-01-06 19:01:29 -05:00
version.rb