ref: master
app/models/concerns/upload_sanitizer.rb
1 2 3 4 5 6 7 8 9 10 11 12
module UploadSanitizer def self.included(base) base.extend(ClassMethods) end module ClassMethods def sanitize_filename before_create { |file| file.filename = Environment.verify_filename(file.filename) } end end end