Skip to content

Commit

Permalink
Add missing attributes for image
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Dec 30, 2024
1 parent 123cb99 commit bd00b49
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/commands/concerns/decidim/ideas/image_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ module Decidim
module Ideas
# A module with all the image attachment common methods
module ImageMethods
include Decidim::AttachmentMethods

private

def build_image
form_image = @form.add_images.compact_blank.first
form_image = @form.add_images.compact_blank

@image = Decidim::Ideas::Attachment.new(
attached_to: @attached_to, # Keep first
title: { I18n.locale.to_s => form_image["title"] },
file: form_image["file"],
weight: 0
title: { I18n.locale.to_s => form_image.first },
file: signed_id_for(form_image.last),
weight: 0,
content_type: content_type_for(form_image.last)
)
end

Expand Down

0 comments on commit bd00b49

Please sign in to comment.