From b21f50d8ae36d9b50b673579e17bccbe55363b34 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Thu, 21 Jun 2018 11:06:32 -0400 Subject: Permit configuring the default service URL expiry --- activestorage/lib/active_storage.rb | 1 + activestorage/lib/active_storage/engine.rb | 1 + activestorage/lib/active_storage/service.rb | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activestorage/lib') diff --git a/activestorage/lib/active_storage.rb b/activestorage/lib/active_storage.rb index e1deee1d82..928db32691 100644 --- a/activestorage/lib/active_storage.rb +++ b/activestorage/lib/active_storage.rb @@ -49,4 +49,5 @@ module ActiveStorage mattr_accessor :paths, default: {} mattr_accessor :variable_content_types, default: [] mattr_accessor :content_types_to_serve_as_binary, default: [] + mattr_accessor :service_urls_expire_in, default: 5.minutes end diff --git a/activestorage/lib/active_storage/engine.rb b/activestorage/lib/active_storage/engine.rb index 519b9ae283..93c5c55b95 100644 --- a/activestorage/lib/active_storage/engine.rb +++ b/activestorage/lib/active_storage/engine.rb @@ -54,6 +54,7 @@ module ActiveStorage ActiveStorage.variable_content_types = app.config.active_storage.variable_content_types || [] ActiveStorage.content_types_to_serve_as_binary = app.config.active_storage.content_types_to_serve_as_binary || [] + ActiveStorage.service_urls_expire_in = app.config.active_storage.service_urls_expire_in || 5.minutes end end diff --git a/activestorage/lib/active_storage/service.rb b/activestorage/lib/active_storage/service.rb index da1af4f745..fe3ef7503a 100644 --- a/activestorage/lib/active_storage/service.rb +++ b/activestorage/lib/active_storage/service.rb @@ -39,8 +39,6 @@ module ActiveStorage extend ActiveSupport::Autoload autoload :Configurator - class_attribute :url_expires_in, default: 5.minutes - class << self # Configure an Active Storage service by name from a set of configurations, # typically loaded from a YAML file. The Active Storage engine uses this -- cgit v1.2.3