Module: Workarea::Configuration::Dragonfly
Instance Method Summary collapse
Instance Method Details
#file_system_defaults ⇒ Object
35 36 37 38 39 40 |
# File 'lib/workarea/configuration/dragonfly.rb', line 35 def file_system_defaults { root_path: Rails.root.join('public/system/workarea', Rails.env).to_s, server_root: Rails.root.join('public').to_s } end |
#load ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/workarea/configuration/dragonfly.rb', line 6 def load type, = *Workarea.config.asset_store = ( || {}).with_indifferent_access if type == :s3 && S3.bucket.present? .reverse_merge!(s3_defaults) elsif %i(file file_system).include?(type) type = :file .reverse_merge!(file_system_defaults) end ::Dragonfly.app(:workarea).configure do # Ensure Dragonfly always uses the CDN no matter what url_host Rails.application.config.action_controller.asset_host datastore type, end end |
#s3_defaults ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/workarea/configuration/dragonfly.rb', line 24 def s3_defaults { region: S3.region, bucket_name: S3.bucket, access_key_id: S3.access_key_id, secret_access_key: S3.secret_access_key, use_iam_profile: S3.access_key_id.blank?, storage_headers: { 'x-amz-acl' => 'private' } } end |