Class: ActiveStorage::Current

Inherits:
ActiveSupport::CurrentAttributes show all
Defined in:
activestorage/app/models/active_storage/current.rb

Overview

:nodoc:

Constant Summary

Constants included from ActiveSupport::Callbacks

ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES

Instance Attribute Summary

Attributes inherited from ActiveSupport::CurrentAttributes

#attributes

Instance Method Summary collapse

Methods inherited from ActiveSupport::CurrentAttributes

attribute, before_reset, clear_all, #initialize, instance, #reset, reset_all, resets, #set

Methods included from ActiveSupport::Callbacks

#run_callbacks

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Constructor Details

This class inherits a constructor from ActiveSupport::CurrentAttributes

Instance Method Details

#hostObject


11
12
13
14
# File 'activestorage/app/models/active_storage/current.rb', line 11

def host
  ActiveSupport::Deprecation.warn("ActiveStorage::Current.host is deprecated, instead use ActiveStorage::Current.url_options")
  self.url_options&.dig(:host)
end

#host=(host) ⇒ Object


6
7
8
9
# File 'activestorage/app/models/active_storage/current.rb', line 6

def host=(host)
  ActiveSupport::Deprecation.warn("ActiveStorage::Current.host= is deprecated, instead use ActiveStorage::Current.url_options=")
  self.url_options = { host: host }
end