summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/file_attachment.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/file_attachment.rb b/app/models/concerns/file_attachment.rb
index 3c094561..e7a33c55 100644
--- a/app/models/concerns/file_attachment.rb
+++ b/app/models/concerns/file_attachment.rb
@@ -52,6 +52,14 @@ module FileAttachment
52 build_upload_proxy 52 build_upload_proxy
53 end 53 end
54 54
55 def has_variant?(style)
56 upload_file_name.present? && File.exist?(file_path(style))
57 end
58
59 def previewable?
60 has_variant?(:medium)
61 end
62
55 private 63 private
56 64
57 def build_upload_proxy 65 def build_upload_proxy