creamy-ghost-62907
09/13/2023, 9:14 PM:file
field. Avo is setting ActiveStorage::Current.url_options
which is fine in development, where I'm using disk
for the storage type, but for staging/production, this results in a URL to the Rails app itself instead of to the relevant S3 bucket. I assume I'm missing some obvious bit of configuration but I... don't know what it is. Can anyone point me in the right direction?miniature-optician-85831
09/13/2023, 9:14 PMcreamy-ghost-62907
09/13/2023, 9:16 PMhas_one_attached
image attachment which is what's busted, and a has_many_attached
for more arbitrary files and... that one seems to be fine.creamy-ghost-62907
09/13/2023, 9:17 PMcreamy-ghost-62907
09/13/2023, 9:18 PMfield :profile_photo, as: :file, hide_on: %i[index], accept: "image/*", is_image: true
The documents field is declared:
field :documents,
as: :files,
hide_on: %i[index],
view_type: :list,
hide_view_type_switcher: true,
accept: Analyzer::LinkedInAnalyzer::ALLOWED_TYPES.join(",")
creamy-ghost-62907
09/13/2023, 9:22 PMstage.yml
(ActiveStorage config) looks like this:
bio_data:
service: S3
bucket: <%= ENV.fetch("DOCUMENTS_BUCKET", "dummy") %>
region: <%= ENV.fetch("DOCUMENTS_BUCKET_REGION", "us-east-1") %>
profile_photos:
service: S3
bucket: <%= ENV.fetch("PROFILES_BUCKET", "dummy") %>
region: <%= ENV.fetch("PROFILES_BUCKET_REGION", "us-east-1") %>
And the relevant ActiveRecord incantations:
has_many_attached :documents, service: :bio_data
has_one_attached :profile_photo, service: :profile_photos
creamy-ghost-62907
09/13/2023, 9:25 PMhttps://profile.sixty.app/<id>
instead of an HMAC'd URL since the contents are very intentionally public but that's a general I-don't-understand-ActiveStorage-yet issue, and not super relevant in the context of Avo.lemon-wall-20836
09/14/2023, 7:22 AMcreamy-ghost-62907
09/14/2023, 3:40 PMlemon-wall-20836
09/14/2023, 5:09 PMcreamy-ghost-62907
09/14/2023, 6:29 PM