From 9436c22e2aa9419f275186967a1b863bc3d01ecb Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 26 Mar 2018 14:36:39 +0100 Subject: Use a current model to provide the host for service urls 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). --- activestorage/app/models/active_storage/current.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 activestorage/app/models/active_storage/current.rb (limited to 'activestorage/app/models/active_storage/current.rb') diff --git a/activestorage/app/models/active_storage/current.rb b/activestorage/app/models/active_storage/current.rb new file mode 100644 index 0000000000..7e431d8462 --- /dev/null +++ b/activestorage/app/models/active_storage/current.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class ActiveStorage::Current < ActiveSupport::CurrentAttributes #:nodoc: + attribute :host +end -- cgit v1.2.3