| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* `HasManyThroughCantDissociateNewRecords` and `HasManyThroughCantAssociateNewRecords`
are no longer used since f6b12c1.
* `ReadOnlyAssociation` is no longer used since 0da426b.
|
|
|
|
| |
Follow up of #31004.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This pull request addresses these 17 failures when tested with Oracle enhanced adapter.
All of these failures are due to the incorrect number of queries. Here is the first one.
```ruby
$ ARCONN=oracle bin/test test/cases/nested_attributes_test.rb:1086
Using oracle
Run options: --seed 27985
F
Finished in 0.874514s, 1.1435 runs/s, 1.1435 assertions/s.
1) Failure:
TestHasManyAutosaveAssociationWhichItselfHasAutosaveAssociations#test_circular_references_do_not_perform_unnecessary_queries [/home/yahonda/git/rails/activerecord/test/cases/nested_attributes_test.rb:1086]:
6 instead of 3 queries were executed.
Queries:
select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
INSERT INTO "SHIPS" ("NAME", "ID") VALUES (:a1, :a2)
select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
INSERT INTO "SHIP_PARTS" ("NAME", "SHIP_ID", "UPDATED_AT", "ID") VALUES (:a1, :a2, :a3, :a4)
select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
INSERT INTO "TREASURES" ("LOOTER_ID", "LOOTER_TYPE", "SHIP_ID", "ID") VALUES (:a1, :a2, :a3, :a4).
Expected: 3
Actual: 6
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```
Since https://github.com/rsim/oracle-enhanced/pull/1490 Oracle enhanced adapter drops its own schema caching called OracleEnhancedAdapter.cache_columns` to use Rails scehema cache
generated by `db:schema:cache:dump`.
By this change some extra sql statements executed at ActiveRecord unit test, which can be
fixed by adding the sql statement to `oracle_ignored`.
* All 17 failures fixed by this pull request:
```ruby
ARCONN=oracle bin/test test/cases/nested_attributes_test.rb:1086
ARCONN=oracle bin/test test/cases/locking_test.rb:308
ARCONN=oracle bin/test test/cases/locking_test.rb:365
ARCONN=oracle bin/test test/cases/dirty_test.rb:351
ARCONN=oracle bin/test test/cases/dirty_test.rb:334
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:192
ARCONN=oracle bin/test test/cases/associations/has_many_associations_test.rb:950
ARCONN=oracle bin/test test/cases/associations/has_many_associations_test.rb:1059
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:627
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:607
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:617
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:641
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:546
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:297
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:586
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:172
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:269
```
|
|\
| |
| | |
Remove redundant return statements
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`join_scopes` in `PolymorphicReflection` is passed aliased `table`, so
it should be respected for `source_type_scope`.
Closes #13969.
Fixes #13920.
Fixes #15190.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Replace the primary key type `integer` in docs with `bigint`.
ref #26266
|
|\ \
| |/
|/|
| | |
Removed unnecessary semicolons
|
|/ |
|
|
|
|
|
| |
- It is present in Rails 5.1.3 already.
- Backport commit https://github.com/rails/rails/commit/9efa0b70a638dcfdc05b30ab530f89f2847bb9c2
|
|
|
|
|
|
|
| |
```
% git grep -n trough
activerecord/test/cases/associations/has_many_through_associations_test.rb:1253: def test_has_many_trough_with_scope_that_has_joined_same_table_with_parent_relation
```
|
| |
|
|\
| |
| | |
delegate scope_for on PolymorphicReflection
|
| | |
|
|/ |
|
|
|
| |
using serializable isolation would prevent the duplicate insert as done in the example from happening
|
| |
|
|\
| |
| | |
Move `extensions` to `PostgreSQL::SchemaDumper`
|
| |
| |
| |
| |
| |
| |
| | |
and abstract `SchemaDumper#extensions` is now an empty method.
Since #30337, every database adapter has its own `SchemaDumper`.
`extensions` are only supported by PostgreSQL database and postgresql database adapter.
|
|\ \
| |/
|/| |
Save index order :desc to schema.rb (sqlite). Fixes #30902
|
| | |
|
| |
| |
| |
| |
| | |
Although the sqlite adapter supports index sort orders, they
weren't being written to db/schema.rb.
|
|/
|
|
|
|
|
|
| |
since the minimum version of PostgreSQL currently Rails supports is 9.1,
there is no need to handle if `supports_extensions?`
Refer https://www.postgresql.org/docs/9.1/static/sql-createextension.html
"CREATE EXTENSION"
|
|
|
|
|
|
| |
Currently alias tracker only refer a table name, doesn't respect an
alias name. Should use `join.left.name` rather than
`join.left.table_name`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`supports_disable_referential_integrity?` used to handle
if PostgreSQL database supports
`ALTER TABLE <table name> DISABLE/ENABLE TRIGGER` statements.
Refer https://github.com/rails/rails/commit/9a947af0e79cfb8692eb7e5ae94c1b8c40756f49
These statements have been documented since 8.1.
https://www.postgresql.org/docs/8.1/static/sql-altertable.html
> DISABLE/ENABLE TRIGGER
Now Rails supports PostgreSQL 9.1 or higher only.
No need to handle `supports_disable_referential_integrity?` anymore.
Also, this method does not exist in any other adapters including AbstractAdapter.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
`initialize_internal_metadata_table`
|
| |
|
| |
|
| |
|
|
|
|
| |
object
|
|
|
|
|
|
|
|
| |
It should be shared the count of alias tracking in both INNER/LEFT JOINs
to avoid duplicate aliases.
Fixes #30504.
Closes #30410.
|
|
|
|
|
| |
Currently we have no test for alias tracking with string joins. I've add
test case for that to catch a future regression.
|
|
|
|
|
| |
Since `MocktailDesigner` inherits `DrinkDesigner` and can not be used
alone.
|
|
|
|
| |
This basically reverts 9d4f79d3d394edb74fa2192e5d9ad7b09ce50c6d
|
|
|
|
| |
It should be initialized only when polymorphic associations.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
bogdanvlviv/fix_ar_internal_metadata_for_a_test_database
Fix `bin/rails db:setup` and `bin/rails db:test:prepare` create wrong ar_internal_metadata's data for a test database.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
database connection
When load schema from `structure.sql`, database connection isn't
established. `ActiveRecord::Tasks::DatabaseTasks.load_schema` has to
establish database connection since it executes
```
ActiveRecord::InternalMetadata.create_table
ActiveRecord::InternalMetadata[:environment] = environment
```
|