Files
docuseal/config/initializers/active_storage.rb
T

20 lines
464 B
Ruby
Raw Normal View History

2023-05-21 17:59:36 +03:00
# frozen_string_literal: true
ActiveSupport.on_load(:active_storage_attachment) do
attribute :uuid, :string, default: -> { SecureRandom.uuid }
has_many_attached :preview_images
end
Rails.configuration.to_prepare do
ActiveStorage::DiskController.after_action do
response.set_header('Cache-Control', 'public, max-age=31536000') if action_name == 'show'
end
LoadActiveStorageConfigs.call
2023-06-09 01:43:43 +03:00
rescue StandardError => e
Rails.logger.debug(e)
2023-05-21 17:59:36 +03:00
nil
end