| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \
| | | | |
| | | | | |
fix example code syntax [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Add yield to with_delivery_job test helper
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Adds yield to parameterized mail test helper so assertions
passed into with_delivery_job are actually ran.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Ref: https://github.com/rails/rails/blob/604fac6d7191fca102380b1a5f5eb9c619fb407f/activestorage/app/models/active_storage/blob.rb#L256-L264
This fixes broken `GCSServiceTest`.
https://travis-ci.org/rails/rails/jobs/461868394#L6624-L6626
Follow up to #34576.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Clarify no support for non PK id columns
[ci skip]
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
[ci skip]
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
mberlanda/mberlanda/as-inheritable-options-intialization
[Realties] config_for as ActiveSupport::OrderedOptions
|
| | | | | | |
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Add a test with extra keys to active_storage Service#upload
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Add ability to block writes to a database
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This PR adds the ability to prevent writes to a database even if the
database user is able to write (ie the database is a primary and not a
replica).
This is useful for a few reasons: 1) when converting your database from
a single db to a primary/replica setup - you can fix all the writes on
reads early on, 2) when we implement automatic database switching or
when an app is manually switching connections this feature can be used
to ensure reads are reading and writes are writing. We want to make sure
we raise if we ever try to write in read mode, regardless of database
type and 3) for local development if you don't want to set up multiple
databases but do want to support rw/ro queries.
This should be used in conjunction with `connected_to` in write mode.
For example:
```
ActiveRecord::Base.connected_to(role: :writing) do
Dog.connection.while_preventing_writes do
Dog.create! # will raise because we're preventing writes
end
end
ActiveRecord::Base.connected_to(role: :reading) do
Dog.connection.while_preventing_writes do
Dog.first # will not raise because we're not writing
end
end
```
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix the scoping with query methods in the scope block
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Follow up #33394.
#33394 only fixes the case of scoping with klass methods in the scope
block which invokes `klass.all`.
Query methods in the scope block also need to invoke `klass.all` to be
affected by the scoping.
|
| | | | | | |
|
| |_|_|_|/
|/| | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Allow aliased attributes in update
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Allow aliased attributes to be used in `#update_columns` and `#update`.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Do nothing when the same block is included again
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If the same block is included multiple times, we no longer raise an exception
or overwrite the included block instance variable.
Fixes #14802.
[Mark J. Titorenko + Vlad Bokov]
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Add a Delayed Job project link.
|
|/ / / / / /
| | | | | |
| | | | | | |
Delayed Job is mentioned multiple times in the document, but it is not linked from anywhere.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Improve ActiveRecord::Querying documentation [ci skip]
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
* Break up long sentences
* Reword some sentences to clarify subject, predicate, and object
* Explain drawbacks of using count_by_sql
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Log exceptions atomically
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
When distributed over multiple logger calls the lines can become
intermixed with other log statements. Combining them into a single
logger call makes sure they always get logged together.
|
|\ \ \ \ \ \ \ \
| |_|/ / / / / /
|/| | | | | | | |
Allow spaces in postgres table names
|
| | |_|_|_|/ /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Fixes issue where "user post" is misinterpreted as "\"user\".\"post\""
when quoting table names with the postgres adapter.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Clarify scope body requirements
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[ci skip]
|
| |/ / / / / /
|/| | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The error can be reproduced with
require "bundler/setup"
require "action_controller"
AbstractController::ActionNotFound
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Patch load error in case GemSpecError
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| |_|_|_|/ / / /
|/| | | | | | | |
Fix `ArgumentError` when uploading to amazon s3
|
|/ / / / / / / |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Parallel execution of `ForkingExecutor` is the same approach as
`Testing::Parallelization`. So do not need to have own code inside
Action Pack. Let's use an already existing feature.
|
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This prevents the array from being dumped as a DRbObject so we can reduce
communication with the server.
In DRb, if `Marshal.dump` fails, `Marshal.dump` is executed again after
converting the object to `DRbObject`. This also possible to reduce the
execution of `Marshal.dump` by converting to a format that can be
marshalized in advance using `DRbObject`.
This is the same approach to Action Pack's parallel test. Ref: 5751b7ea58d7cf259dda30fb42fff51fc6ae93d5
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
after `/' operator"
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix broken ASt build
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`ActiveStorage::Filename#parameters` was removed by #33829.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Since 06ab7b27ea1c1ab357085439abacdb464f6742bf,
`GCSServiceTest#test_signed_URL_response_headers` is broken.
https://travis-ci.org/rails/rails/jobs/460454477#L7084-L7087
This seems to be due to lack of `content_type` at upload.
This is solved by specifying `conten_type`.
However, since the same content is also tested with `test_upload_with_content_type`,
it will be duplicated content, so I think that can remove `test_signed_URL_response_headers`.
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
Use raw time string from DB to generate ActiveRecord#cache_version
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When an `updated_at` column exists on the model, but is not available on the instance (likely due to a select), we should raise an error rather than silently not generating a cache_version. Without this behavior it's likely that cache entries will not be able to be invalidated and this will happen without notice.
This behavior was reported and described by @lsylvester in https://github.com/rails/rails/pull/34197#issuecomment-429668759.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Currently, the `updated_at` field is used to generate a `cache_version`. Some database adapters return this timestamp value as a string that must then be converted to a Time value. This process requires a lot of memory and even more CPU time. In the case where this value is only being used for a cache version, we can skip the Time conversion by using the string value directly.
- This PR preserves existing cache format by converting a UTC string from the database to `:usec` format.
- Some databases return an already converted Time object, in those instances, we can directly use `created_at`.
- The `updated_at_before_type_cast` can be a value that comes from either the database or the user. We only want to optimize the case where it is from the database.
- If the format of the cache version has been changed, we cannot apply this optimization, and it is skipped.
- If the format of the time in the database is not UTC, then we cannot use this optimization, and it is skipped.
Some databases (notably PostgreSQL) returns a variable length nanosecond value in the time string. If the value ends in a zero, then it is truncated For instance instead of `2018-10-12 05:00:00.000000` the value `2018-10-12 05:00:00` is returned. We detect this case and pad the remaining zeros to ensure consistent cache version generation.
Before: Total allocated: 743842 bytes (6626 objects)
After: Total allocated: 702955 bytes (6063 objects)
(743842 - 702955) / 743842.0 # => 5.4% ⚡️⚡️⚡️⚡️⚡️
Using the CodeTriage application and derailed benchmarks this PR shows between 9-11% (statistically significant) performance improvement versus the commit before it.
Special thanks to @lsylvester for helping to figure out a way to preserve the usec format and for helping with many implementation details.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix minor Active Storage docs typo [ci skip]
|
|/ / / / / / / |
|