make public storage and direct upload optional
This commit is contained in:
@@ -19,6 +19,10 @@ module Docuseal
|
||||
ENV['MULTITENANT'] == 'true'
|
||||
end
|
||||
|
||||
def active_storage_public?
|
||||
ENV['ACTIVE_STORAGE_PUBLIC'] == 'true'
|
||||
end
|
||||
|
||||
def default_url_options
|
||||
return DEFAULT_URL_OPTIONS if multitenant?
|
||||
|
||||
|
||||
@@ -98,7 +98,8 @@ module Submissions
|
||||
(area['x'] * width) + (area['w'] * width) + TEXT_LEFT_MARGIN,
|
||||
height - (area['y'] * height) - lines[..next_index].sum(&:height) + height_diff
|
||||
],
|
||||
A: { Type: :Action, S: :URI, URI: attachment.url }
|
||||
A: { Type: :Action, S: :URI,
|
||||
URI: h.rails_blob_url(attachment, **Docuseal.default_url_options) }
|
||||
}
|
||||
)
|
||||
|
||||
@@ -260,5 +261,9 @@ module Submissions
|
||||
.write_to_buffer('.png')
|
||||
end
|
||||
end
|
||||
|
||||
def h
|
||||
Rails.application.routes.url_helpers
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user