| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
For now, we don't want to take "scoping" calls in to account when
calculating cache keys for relations, so just opt-out.
|
|
|
|
|
| |
emit an event when we instantiate AR objects so we can see how many
records were instantiated and how long it took
|
| |
|
|\
| |
| | |
Autosave callbacks shouldn't be `after_save` callbacks
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
068f092ced8483e557725542dd919ab7c516e567 registered autosave callbacks
as `after_save` callbacks. This caused the regression described in #17209.
Autosave callbacks should be registered as `after_update` and
`after_create` callbacks, just like before.
This is a partial revert of 068f092ced8483e557725542dd919ab7c516e567.
Fixes #17209.
|
|/ |
|
|\
| |
| | |
speed up fixtures by not loading all their classes
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Honoring an overidden `rack.test` allows testing closed connection between
multiple requests. This is useful if you're working on database resiliency, to
ensure the connection is in the expected state from one request to another on
the same worker.
|
|/
|
|
|
|
| |
it doesn't work on SQLite3 since it doesn't support truncate, but that's
OK. If you call truncate on the connection, you're now bound to that
database (same as if you use hstore or any other db specific feature).
|
| |
|
|
|
|
| |
:foreign_key option that's a symbol
|
|
|
|
|
| |
This test has always been green because it uses "assert" and the first
argument is an truthy class/object.
|
| |
|
|
|
|
|
|
|
|
|
| |
For now, we will just skip the cache when a non-column key is used in the hash.
If the future, we can probably move some of the logic in PredicateBuilder.expand
up the chain to make caching possible for association queries.
Closes #16903
Fixes #16884
|
|\
| |
| | |
Update RecordNotFound exception cases to include a message with the
|
| |
| |
| |
| | |
Model that the Record was not found in.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Don't autosave unchanged has_one through records
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
|
| | | |
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
Closes #16907.
[Matthew Draper & Yves Senn]
|
|\ \
| | |
| | |
| | | |
Data corruption risk: Roll back open transactions when the running thread is killed.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Working with two different machines is hard :sweat:
|
| | |
| | |
| | |
| | |
| | |
| | | |
[Matthew Draper & Yves Senn]
Closes #16860. (pull request to discuss the implementation)
|
|\ \ \
| | | |
| | | |
| | | | |
Default to sorting user's test cases for now
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Goals:
1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase
Fixes #16769
|
| | | |
| | | |
| | | |
| | | | |
Dump the standard schema once instead of redoing it per test
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Allows :limit defaults to be changed without pulling the rug out from
under old migrations that omitted :limit because it matched the default
at the time.
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
to drop sequences at the same time each tables dropped for Oracle
|
| | | |
| | | |
| | | |
| | | | |
/cc @yahonda
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Closes #10247.
The same goes for tables with an "id" column but without primary key constraint.
Reading from the view works without configuration. If you have an updateable view
you need to use `self.primary_key = ''`.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
SQLite3Adapter now checks for views in table_exists? fixes: 14041
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on
in adapter subclasses. Currently the flag only controls test execution.
/cc @yahonda
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Closes #16684.
This is achieved by always generating `GeneratedAssociationMethods` when
`ActiveRecord::Base` is subclassed. When some of the included modules
of `ActiveRecord::Base` were reordered this behavior was broken as
`Core#initialize_generated_modules` was no longer called. Meaning that
the module was generated on first access.
|
|\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | | |
disable migrations logging while running test cases for AR schema tests
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`User.where(id: [[1,2],3])` was equal to `User.where(id:[1, 2, 3])`
in Rails 4.1.x but because of some refactoring in Arel this stopped
working in 4.2.0. This fixes it in Rails.
[Dan Olson & Cristian Bica]
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This fixes <"SQLite3::SQLException: no such column: legacy_things.person_id: SELECT \"legacy_things\".* FROM \"legacy_things\" WHERE \"legacy_things\".\"person_id\" = ?">
in OptimisticLockingTest#test_lock_destroy
|
|\ \ \ \
| | | | |
| | | | | |
[Postgresql tests] Added enable_extension! to helper
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Callback order in Active Record objects are important. Users should not
define callbacks before the association definition or surprising
behaviours like the described at #3798 will happen. This callback order
dependency is documented at https://github.com/rails/rails/blob/31bfcdc77ca0d8cec9b5fe513bdc6f05814dd4f1/activerecord/lib/active_record/associations.rb#L1222-1227.
This reverts #15728.
Fixes #16620.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is cased by 03118bc + 9b5d603. The first commit referenced the undefined
local variable `column` when it should be using `reflection.type` as the lookup
key. The second commit changed `build_arel` to not modify the `bind_values` in-
place so we need to combine the arel's `bind_values` with the relation's when
building the SQL.
Fixes #16591
Related #15821 / #15892 / 7aeca50
|