Fix for remote filesytem paperclip configuration.
This commit is contained in:
@@ -24,11 +24,11 @@ class Document < ActiveRecord::Base
|
||||
before_save :set_attachment_from_cached_attachment, if: -> { cached_attachment.present? }
|
||||
after_save :remove_cached_attachment, if: -> { cached_attachment.present? }
|
||||
|
||||
def set_cached_attachment_from_attachment(prefix)
|
||||
def set_cached_attachment_from_attachment
|
||||
self.cached_attachment = if Paperclip::Attachment.default_options[:storage] == :filesystem
|
||||
attachment.path
|
||||
else
|
||||
prefix + attachment.url
|
||||
attachment.url
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user