Skip to content

Commit 12f649b

Browse files
committed
Rubocop fixes
1 parent 650c33e commit 12f649b

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

app/helpers/better_together/image_helper.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module BetterTogether
44
# Helps with rendering images for various entities
5-
module ImageHelper
5+
module ImageHelper # rubocop:todo Metrics/ModuleLength
66
# rubocop:todo Metrics/PerceivedComplexity
77
# rubocop:todo Metrics/CyclomaticComplexity
88
# rubocop:todo Metrics/AbcSize
@@ -46,36 +46,36 @@ def card_image_tag(entity, options = {}) # rubocop:todo Metrics/MethodLength, Me
4646
image_alt = options[:alt] || 'Card Image'
4747
image_title = options[:title] || 'Card Image'
4848
image_tag_attributes = {
49-
class: image_classes,
50-
style: image_style,
51-
alt: image_alt,
52-
title: image_title
49+
class: image_classes,
50+
style: image_style,
51+
alt: image_alt,
52+
title: image_title
5353
}
5454

5555
# Determine if entity has a card image
5656
if entity.respond_to?(:card_image) && entity.card_image.attached?
57-
attachment = if entity.respond_to?(:optimized_card_image)
58-
entity.optimized_card_image
59-
else
60-
entity.card_image_variant(image_width, image_height)
61-
end
57+
attachment = if entity.respond_to?(:optimized_card_image)
58+
entity.optimized_card_image
59+
else
60+
entity.card_image_variant(image_width, image_height)
61+
end
6262

63-
image_tag(attachment.url, **image_tag_attributes)
63+
image_tag(attachment.url, **image_tag_attributes)
6464
else
65-
# Use a default image based on the entity type
66-
default_image = default_card_image(entity, image_format)
67-
image_tag(image_url(default_image), **image_tag_attributes)
65+
# Use a default image based on the entity type
66+
default_image = default_card_image(entity, image_format)
67+
image_tag(image_url(default_image), **image_tag_attributes)
6868
end
6969
end
7070

7171
def default_card_image(entity, image_format)
7272
case entity.class.name
7373
when 'BetterTogether::Person'
74-
"card_images/default_card_image_person.#{image_format}"
74+
"card_images/default_card_image_person.#{image_format}"
7575
when 'BetterTogether::Community'
76-
"card_images/default_card_image_community.#{image_format}"
76+
"card_images/default_card_image_community.#{image_format}"
7777
else
78-
"card_images/default_card_image_generic.#{image_format}"
78+
"card_images/default_card_image_generic.#{image_format}"
7979
end
8080
end
8181
# rubocop:enable Metrics/AbcSize

0 commit comments

Comments
 (0)