File tree Expand file tree Collapse file tree 5 files changed +38
-31
lines changed Expand file tree Collapse file tree 5 files changed +38
-31
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ module DownloadableFile
33 extend ActiveSupport ::Concern
44
55 included do
6- has_attached_file :file , Settings . paperclip . to_hash . merge ( validate_media_type : false )
6+ has_attached_file :file , PaperclipSettings . config . merge ( validate_media_type : false )
77
88 # TODO: Limit attachment types for safe uploads
99 do_not_validate_attachment_file_type :file
1010 end
1111
1212 def download_url
13- if fog?
13+ if PaperclipSettings . fog?
1414 # This is a workaround due to a bug or limitation in fog to generate a
1515 # private, expiring URL and have it force a download.
1616 #
@@ -31,10 +31,4 @@ def download_url
3131 end
3232 end
3333
34- private
35-
36- def fog?
37- Settings . paperclip . storage == "fog"
38- end
39-
4034end
Original file line number Diff line number Diff line change 1313Paperclip . options [ :content_type_mappings ] = {
1414 xls : "CDF V2 Document, No summary info" ,
1515}
16+
17+ class PaperclipSettings
18+
19+ def self . config
20+ secrets = Hash ( Rails . application . secrets . paperclip ) . symbolize_keys
21+ Settings . paperclip . to_hash . merge ( secrets )
22+ end
23+
24+ def self . fog?
25+ config [ :storage ] == "fog"
26+ end
27+
28+ end
Original file line number Diff line number Diff line change 11development:
22 secret_key_base: ~
33
4+ # You should change this if you want to be able to access the API
5+ api:
6+ basic_auth_name: <%= SecureRandom.hex %>
7+ basic_auth_password: <%= SecureRandom.hex %>
8+
9+ # You should change this if you want to be able to access the SecureRooms API
10+ secure_rooms_api:
11+ basic_auth_name: <%= SecureRandom.hex %>
12+ basic_auth_password: <%= SecureRandom.hex %>
13+
14+ # Uncomment these lines if you wish to use S3 in your application.
15+ # paperclip:
16+ # storage: fog
17+ # fog_credentials:
18+ # provider: AWS
19+ # aws_access_key_id: Your-Key-Here
20+ # aws_secret_access_key: Your-Key-Here
21+ # fog_directory: Your-Bucket-Name-Here
22+ # fog_public: false
23+ # path: ":class/:attachment/:id_partition/:style/:safe_filename"
24+
25+
426test:
527 secret_key_base: needs_a_value_for_ci
628
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -86,16 +86,6 @@ relays:
8686 admin_enabled : true
8787 reservation_enabled : true
8888
89- # You should change this if you want to be able to access the API
90- api :
91- basic_auth_name : <%= SecureRandom.hex %>
92- basic_auth_password : <%= SecureRandom.hex %>
93-
94- # You should change this if you want to be able to access the SecureRooms API
95- secure_rooms_api :
96- basic_auth_name : <%= SecureRandom.hex %>
97- basic_auth_password : <%= SecureRandom.hex %>
98-
9989#
10090# For these settings use SettingsHelper#feature_on?
10191feature :
@@ -135,7 +125,7 @@ split_accounts:
135125 - administrator
136126 # - account_manager
137127
138- # This may be overridden in settings.local .yml if your fork is using S3, so
128+ # This may be overridden in secrets .yml if your fork is using S3, so
139129# be sure to check there for configuration
140130paperclip :
141131 storage : filesystem
You can’t perform that action at this time.
0 commit comments