* Update service.rb
The documentation for using the Active Storage from outside of the Ruby on Rails application is not according to the implementation. According to the implementation, we are looking for the env name instead of the `service` name in the configuration which is a hash( same as loading a `storage.yml`)
* Update service.rb
* Update service.rb
Affected gems:
* actionmailbox
* activestorage
* actiontext
This fixes the following warning:
DEPRECATION WARNING: Using legacy connection handling is deprecated. Please set
`legacy_connection_handling` to `false` in your application.
The new connection handling does not support `connection_handlers`
getter and setter.
Read more about how to migrate at: https://guides.rubyonrails.org/active_record_multiple_databases.html#migrate-to-the-new-connection-handling
(called from require at ~/.gem/ruby/3.1.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34)
This allows calls of `ActiveStorage::Blob#url` to have more
interaction with the S3 Presigner, enabling, amongst other options,
custom S3 domain URL Generation.
Closes#42488
The configuration key is `config.active_storage.video_preview_arguments`.
This commit also better documents a previous commit from Jonathan Hefner (@ jonathanhefner) that changes the default video image preview to use scene detection to generate a better preview.
Both methods are defined in multiple parts of the framework. It would
be useful to put them in a proper place, so that repetition is
avoided.
I chose the implementation from `ActiveRecord` because it's a bit more
complete with the `SQLCounter` class, and also because other parts
depend on it.
This is a follow up of #42256.
Purging a not persisted record no longer raise an error for
`has_many_attached`.
Moves the `purge` and `purge_later` logic of `ActiveStorage::Attached`
to `Attached::Changes` API.
Currently Active Storage [variant tracking](https://github.com/rails/rails/pull/37901) runs a query for each attachment to check for a variant. Regular Rails n+1 prevention techniques (`includes`) cannot prevent this.
This PR adds `with_all_variant_records`, as well as allowing `includes` to work as expected on Active Storage attachments.
```ruby
user.vlogs.with_all_variant_records.map do |vlog|
vlog.representation(resize: "100x100").processed
end
```
Fixes several of the comments in https://github.com/rails/rails/pull/37901
In implementing this, I borrowed heavily from the style of https://github.com/rails/rails/pull/39397