Commit Graph

762 Commits

Author SHA1 Message Date
Ryuta Kamizono e50b0e3ab3 Fixup CHANGELOGs [ci skip] 2021-07-21 10:08:08 +09:00
Ryuta Kamizono 9e9c563a04 ✂️ [ci skip] 2021-07-21 08:54:17 +09:00
Jonathan Hefner acfadacb07 Fix ActiveStorage::Preview#download method doc [ci-skip]
Follow-up to #42742.
2021-07-20 09:32:44 -05:00
Eileen M. Uchitelle 990bcac6f8
Merge pull request #42742 from dmarcoux/document-active_storage-preview-download
Document ActiveStorage::Preview#download [ci-skip]
2021-07-20 08:44:43 -04:00
Dany Marcoux 460a5aeecc
Document ActiveStorage::Preview#download 2021-07-20 10:24:26 +02:00
Zachary Scott c0911e9a36
Merge pull request #42740 from dmarcoux/document-active_storage-attachment-variant
Document ActiveStorage::Attachment#variant
2021-07-20 12:18:06 +09:00
Santiago Bartesaghi e9accafc84 Fix #41388 by preserving protocol and port when generating routes 2021-07-19 09:44:55 -03:00
Akanksha fd7b030b6f
Update service.rb (#42766)
* 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
2021-07-14 10:13:15 -04:00
Adam P. Regasz-Rethy dfd19e1a76 Add error handling for metadata server 2021-07-13 16:09:11 -04:00
Dany Marcoux 1cfeca9cf3
Document ActiveStorage::Attachment#variant 2021-07-13 21:57:19 +02:00
Adam P. Regasz-Rethy ae90855375 Optionally use IAM for URL signing instead of :credentials 2021-07-13 15:44:08 -04:00
Dirkjan Bussink 0523532a3c
Always use OpenSSL constants for Digest operations
As also previously discussed in
https://github.com/rails/rails/pull/40770#issuecomment-748347066, this
moves the usage of Digest constants to always use the OpenSSL version of
those Digest implementations.
2021-06-30 13:57:54 +02:00
Santiago Bartesaghi 61a8cd6c8f Deprecate replace_on_assign_to_many 2021-06-28 11:22:31 -03:00
Santiago Bartesaghi 65b1e1bb8d Remove already deprecated methods in ActiveStorage 2021-06-27 20:32:05 -03:00
Anton Topchii 14ea877004 ActiveStorage::Representations controllers:
add support of strict_loading_by_default
2021-06-27 11:06:47 +03:00
Santiago Bartesaghi 63dd10cbb8 Improve ActiveStorage security documentation [ci skip] 2021-06-25 08:06:32 -03:00
Rafael França ca6ed3fdeb
Merge pull request #42378 from fatkodima/active_storage-migration-primary-key-type
Respect Active Record's primary_key_type in Active Storage migrations
2021-06-23 14:07:57 -04:00
Jacopo 8bb97eaa1e Allow to detach an attachment when record is not persisted
Detaching a not persisted record no longer raise an error.

Moves the `detach` logic of `ActiveStorage::Attached` to `Attached::Changes API`.
2021-06-21 11:27:49 +02:00
Andrew White 1f16768ec3
Merge pull request #42005 from FestaLab/activestorage/vips-analyzer
Add support for vips in the image analyzer
2021-06-21 10:26:53 +01:00
Anton Topchii 379232ffaf Fix ActiveStorage tests for load_defaults 7.0 2021-06-21 07:44:33 +09:00
Zachary Scott c797ce966c Update test dummy application defaults
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)
2021-06-21 07:00:32 +09:00
Breno Gazzola 82fdf45fe5 Add support to libvips in the image analyzer 2021-06-20 16:51:51 -03:00
Breno Gazzola 48a7ec49bf Add metadata value for presence of video channel in video blobs 2021-06-19 09:56:41 -03:00
Marc-Antoine Leblond 25f1eec32a
Fix test failing in GCS service 2021-06-18 11:07:20 -04:00
Rafael Mendonça França e2585a21e3
Merge pull request #42506 2021-06-17 21:33:27 +00:00
Rafael França b307450c9b
Merge pull request #42504 from josegomezr/activestorage_s3_pass_client_opts
Passing extra parameters in `ActiveStorage::Blob#url` to S3 Client
2021-06-17 16:32:42 -04:00
Rafael França 58ed26f616
Revert "Extract methods `assert_queries` and `assert_no_queries`" 2021-06-17 13:35:25 -04:00
Jacopo c8c967b535 Deprecate usage of `purge` and `purge_later` from the association extension.
Calling `purge` and `purge_later` from the association extension raise a
deprecation warning.
These methods will be removed in the `6.2` release.
2021-06-17 15:22:03 +02:00
Jose D. Gomez R 302f708729
Passing extra parameters in `ActiveStorage::Blob#url` to S3 Client
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
2021-06-17 13:34:27 +02:00
Marc-Antoine Leblond a22710ed0d
Fix indentation 2021-06-16 11:53:49 -04:00
Marc-Antoine Leblond e3fe39285f
Support default `cache_control` in GCS Active Storage 2021-06-16 11:53:21 -04:00
Brendon Muir 54cde9d4c7 ActiveStorage: The parameters sent to `ffmpeg` for are now configurable
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.
2021-06-16 14:15:34 +12:00
Andrew White 1e1ca11c1c
Merge pull request #42410 from aki77/activestorage-expiring-url
Add support for ActiveStorage expiring URLs
2021-06-14 20:01:41 +01:00
Andrew White 26c00cb3da
Merge pull request #42465 from ricardotk002/extract-assert-queries
Extract methods `assert_queries` and `assert_no_queries`
2021-06-14 19:56:40 +01:00
Alex Ghiculescu 1c11237538
Update activestorage/app/models/active_storage/variant_with_record.rb
Co-authored-by: Petrik de Heus <petrik@deheus.net>
2021-06-14 12:45:04 -05:00
Alex Ghiculescu 7f348eb9d4 Document Active Storage & Action Text eager loading
Docs for https://github.com/rails/rails/pull/40842 + https://github.com/rails/rails/pull/39397

[ci skip]
2021-06-14 11:03:48 -05:00
Ricardo Díaz f644f7d35b Extract methods `assert_queries` and `assert_no_queries`
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.
2021-06-14 09:55:13 -05:00
aki 209a79aeed Add support for ActiveStorage expiring URLs 2021-06-14 20:45:01 +09:00
Jacopo a8a60652a3 Fix ActiveStorage has_many_attached when record is not persisted
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.
2021-06-12 19:49:21 +02:00
Alex Ghiculescu 8e3ad47ef2
Merge branch 'main' into activestorage-variant-nplusone 2021-06-11 12:54:09 -05:00
fatkodima 753633abdf Respect Active Record's primary_key_type in Active Storage migrations 2021-06-11 11:51:07 +03:00
Jean Boussier 8ae1339ae0 Make `reading_role` and `writing_role` module instance variables
Followup: https://github.com/rails/rails/pull/42442
2021-06-10 18:24:37 +02:00
Breno Gazzola dd85734d2f Add metadata value for presence of audio channel in video blobs 2021-06-09 08:32:18 -03:00
Breno Gazzola d2c5babf4b Add audio analyzer to active storage 2021-06-08 16:11:00 -03:00
aki 1dc175338b Allow expires_in for ActiveStorage signed ids 2021-06-05 05:41:11 +09:00
Jacopo 851898114b Add `ActiveRecord::Base#previously_persisted?`
Returns `true` if the object has been previously persisted but now it has been deleted.

This is a follow up of https://github.com/rails/rails/pull/42256/files#r641914920
2021-06-04 13:06:51 +02:00
Zachary Scott f52293fcc6
Merge pull request #42363 from santib/improve-activestorage-cdn-docs
Add docs for CDN in front of ActiveStorage
2021-06-04 08:50:15 +09:00
Santiago Bartesaghi 1416679d2d Add docs for CDN in front of ActiveStorage [ci skip]
Co-authored-by: Bruno Vezoli <brunvezoli@hotmail.com>
Co-authored-by: Juan Eduardo Roig <jeroig@gmail.com>
2021-06-03 14:03:10 -03:00
Alex Ghiculescu c39d48686b Add `with_all_variant_records` method to eager load all variant records on an attachment at once
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
2021-06-03 09:50:43 -05:00
Abhay Nikam 0b46d5c184 Document ActiveStorage::Attached::One#blank? [ci skip] 2021-06-03 00:28:25 +05:30