Class: AdSpace::App

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_space/app.rb

Class Method Summary collapse

Class Method Details

.init(request:) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/ad_space/app.rb', line 4

def init(request:)
  # Set the current host for ActiveStorage
  begin
    if defined?(ActiveStorage::Current)
      ActiveStorage::Current.url_options = {protocol: request.protocol, host: request.host, port: request.port}
    end
  rescue => exception
    Rails.logger.debug "[AdSpace] Failed to set ActiveStorage::Current.url_options, #{exception.inspect}"
  end
end