diff options
author | Starfall <us@starfall.systems> | 2023-07-07 11:49:24 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-07-07 11:49:24 -0500 |
commit | a9de0735d2ad2fc615169507ba6215fa17da8c18 (patch) | |
tree | fbf0520231f4f31067b2b6a66d1b7ff701b6d904 /app/models | |
parent | 862ffc96153d299402791715766e2584a744dec4 (diff) | |
parent | 0f2adc26fc6aeb82ba7174f14e6b5804f336c381 (diff) |
Merge branch 'main' into hotfix
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/attachmentable.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/concerns/attachmentable.rb b/app/models/concerns/attachmentable.rb index d44c22438..28591ab72 100644 --- a/app/models/concerns/attachmentable.rb +++ b/app/models/concerns/attachmentable.rb @@ -22,15 +22,14 @@ module Attachmentable included do def self.has_attached_file(name, options = {}) # rubocop:disable Naming/PredicateName - options = { validate_media_type: false }.merge(options) super(name, options) - send(:"before_#{name}_post_process") do + + send(:"before_#{name}_validate") do attachment = send(name) check_image_dimension(attachment) set_file_content_type(attachment) obfuscate_file_name(attachment) set_file_extension(attachment) - Paperclip::Validators::MediaTypeSpoofDetectionValidator.new(attributes: [name]).validate(self) end end end |