2017-08-12 08:32:15 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-24 15:18:00 -04:00
|
|
|
#--
|
2020-12-31 22:21:20 -05:00
|
|
|
# Copyright (c) 2017-2021 David Heinemeier Hansson, Basecamp
|
2017-07-24 15:18:00 -04:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be
|
|
|
|
# included in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
#++
|
|
|
|
|
2017-06-30 13:12:58 -04:00
|
|
|
require "active_record"
|
2017-08-01 17:50:53 -04:00
|
|
|
require "active_support"
|
|
|
|
require "active_support/rails"
|
2019-02-20 16:07:34 -05:00
|
|
|
require "active_support/core_ext/numeric/time"
|
2018-01-10 12:12:04 -05:00
|
|
|
|
2017-10-21 09:27:49 -04:00
|
|
|
require "active_storage/version"
|
2018-01-10 12:12:04 -05:00
|
|
|
require "active_storage/errors"
|
2017-06-30 13:12:58 -04:00
|
|
|
|
2018-01-15 13:06:17 -05:00
|
|
|
require "marcel"
|
|
|
|
|
2017-07-06 05:33:29 -04:00
|
|
|
module ActiveStorage
|
2017-06-30 13:12:58 -04:00
|
|
|
extend ActiveSupport::Autoload
|
|
|
|
|
2017-07-24 15:22:59 -04:00
|
|
|
autoload :Attached
|
2021-01-24 05:10:30 -05:00
|
|
|
autoload :FixtureSet
|
2017-07-06 06:22:44 -04:00
|
|
|
autoload :Service
|
2017-09-28 16:43:37 -04:00
|
|
|
autoload :Previewer
|
2017-10-22 13:16:59 -04:00
|
|
|
autoload :Analyzer
|
2017-07-23 12:03:25 -04:00
|
|
|
|
2019-03-31 19:23:11 -04:00
|
|
|
mattr_accessor :logger
|
|
|
|
mattr_accessor :verifier
|
2019-07-20 06:33:11 -04:00
|
|
|
mattr_accessor :variant_processor, default: :mini_magick
|
|
|
|
|
2019-03-31 19:23:11 -04:00
|
|
|
mattr_accessor :queues, default: {}
|
2019-07-20 06:33:11 -04:00
|
|
|
|
2019-03-31 19:23:11 -04:00
|
|
|
mattr_accessor :previewers, default: []
|
2019-07-20 06:33:11 -04:00
|
|
|
mattr_accessor :analyzers, default: []
|
|
|
|
|
2019-03-31 19:23:11 -04:00
|
|
|
mattr_accessor :paths, default: {}
|
2019-07-20 06:33:11 -04:00
|
|
|
|
|
|
|
mattr_accessor :variable_content_types, default: []
|
2020-04-19 15:59:39 -04:00
|
|
|
mattr_accessor :web_image_content_types, default: []
|
2019-07-20 06:33:11 -04:00
|
|
|
mattr_accessor :binary_content_type, default: "application/octet-stream"
|
2018-01-04 13:35:54 -05:00
|
|
|
mattr_accessor :content_types_to_serve_as_binary, default: []
|
2019-07-20 06:33:11 -04:00
|
|
|
mattr_accessor :content_types_allowed_inline, default: []
|
|
|
|
|
2018-06-21 11:06:32 -04:00
|
|
|
mattr_accessor :service_urls_expire_in, default: 5.minutes
|
2019-07-20 06:33:11 -04:00
|
|
|
|
2019-03-31 19:23:11 -04:00
|
|
|
mattr_accessor :routes_prefix, default: "/rails/active_storage"
|
2019-07-12 15:30:28 -04:00
|
|
|
mattr_accessor :draw_routes, default: true
|
2020-05-11 16:21:58 -04:00
|
|
|
mattr_accessor :resolve_model_to_route, default: :rails_storage_redirect
|
2018-08-10 12:10:13 -04:00
|
|
|
|
2019-07-20 06:33:11 -04:00
|
|
|
mattr_accessor :replace_on_assign_to_many, default: false
|
2019-12-05 22:21:24 -05:00
|
|
|
mattr_accessor :track_variants, default: false
|
2019-07-20 06:33:11 -04:00
|
|
|
|
2018-08-10 12:10:13 -04:00
|
|
|
module Transformers
|
|
|
|
extend ActiveSupport::Autoload
|
|
|
|
|
|
|
|
autoload :Transformer
|
|
|
|
autoload :ImageProcessingTransformer
|
|
|
|
end
|
2017-07-03 11:07:07 -04:00
|
|
|
end
|