1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activestorage/lib
Alberto Vena f971a3f85d
Raise a meaningful error if ActiveStorage::Current.host is blank
It's very hard to understand what happens with the following exception

  URI::InvalidURIError:
    bad URI(is not URI?): nil

that is raised when trying to generate a URL for Disk service without
setting the ActiveStorage::Current.host first.

This can happen when the ActiveStorage::SetCurrent is not included
in a controller, or when testing URL generation outside of the
controllers layer (eg. testing URL generation in a model).

Co-authored-by: elia <elia@schito.me>
Co-authored-by: filippo <dev@mailvore.com>
2021-05-10 17:27:17 +02:00
..
active_storage Raise a meaningful error if ActiveStorage::Current.host is blank 2021-05-10 17:27:17 +02:00
tasks Add foreign key to active_storage_attachments for blob_id via new migration 2019-01-16 13:13:23 +00:00
active_storage.rb Improve Fixture support for Active Storage (#41065) 2021-01-24 11:10:30 +01:00