mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
9436c22e2a
Trying to pass the current request down to the service so that it can create full urls instead of paths makes the API messy so use a model based on ActiveSupport::CurrentAttributes to provide the current host to services that need it (primarily the disk service).
10 lines
270 B
Ruby
10 lines
270 B
Ruby
# frozen_string_literal: true
|
|
|
|
# The base controller for all ActiveStorage controllers.
|
|
class ActiveStorage::BaseController < ActionController::Base
|
|
protect_from_forgery with: :exception
|
|
|
|
before_action do
|
|
ActiveStorage::Current.host = request.base_url
|
|
end
|
|
end
|