Skip to content

Commit aea049b

Browse files
committed
Use proxy for active storage urls
1 parent 72e6840 commit aea049b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/helpers/better_together/image_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def card_image_tag(entity, options = {}) # rubocop:todo Metrics/MethodLength, Me
6060
entity.card_image_variant(image_width, image_height)
6161
end
6262

63-
image_tag(attachment.url, **image_tag_attributes)
63+
image_tag(rails_storage_proxy_url(attachment), **image_tag_attributes)
6464
else
6565
# Use a default image based on the entity type
6666
default_image = default_card_image(entity, image_format)
@@ -107,7 +107,7 @@ def profile_image_tag(entity, options = {}) # rubocop:todo Metrics/MethodLength,
107107
entity.profile_image_variant(image_size)
108108
end
109109

110-
image_tag(attachment.url, **image_tag_attributes)
110+
image_tag(rails_storage_proxy_url(attachment), **image_tag_attributes)
111111
else
112112
# Use a default image based on the entity type
113113
default_image = default_profile_image(entity, image_format)

app/models/concerns/better_together/content/block_attributes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def block_styles # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
148148

149149
bg_image_style = [
150150
# rubocop:todo Layout/LineLength
151-
"url(#{Rails.application.routes.url_helpers.rails_representation_url(optimized_background_image)})", background_image.presence
151+
"url(#{Rails.application.routes.url_helpers.rails_storage_proxy_url(optimized_background_image)})", background_image.presence
152152
# rubocop:enable Layout/LineLength
153153
].reject(&:blank?).join(', ')
154154
styles = styles.merge({

0 commit comments

Comments
 (0)