diff --git a/app/models/custom/image.rb b/app/models/custom/image.rb new file mode 100644 index 000000000000..41a7fb6cde4c --- /dev/null +++ b/app/models/custom/image.rb @@ -0,0 +1,11 @@ +require_dependency Rails.root.join("app", "models", "image").to_s + +class Image < ApplicationRecord + def variant(style) + if style + attachment.variant(self.class.styles[style].merge(strip: true)) + else + attachment.variant(strip: true) + end + end +end