diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-30 21:32:11 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-30 21:34:59 +0100 |
commit | 14bd46946d25186044485aa101dd2da976b61181 (patch) | |
tree | 94b59b79d06165469a103b9391ddfaee537e0cab /app/controllers/concerns | |
parent | 1b447c190eb47117e99ff1e3c754f9cc461202f1 (diff) |
Per-status control for unlisted mode, also federation for unlisted mode
Fix #233, fix #268
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/obfuscate_filename.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/concerns/obfuscate_filename.rb b/app/controllers/concerns/obfuscate_filename.rb new file mode 100644 index 000000000..9f12cb7e9 --- /dev/null +++ b/app/controllers/concerns/obfuscate_filename.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +module ObfuscateFilename + extend ActiveSupport::Concern + + class_methods do + def obfuscate_filename(*args) + before_action { obfuscate_filename(*args) } + end + end + + def obfuscate_filename(path) + file = params.dig(*path) + return if file.nil? + + file.original_filename = 'media' + File.extname(file.original_filename) + end +end |