Skip to content
Prev Previous commit
Next Next commit
rubocop fixes
  • Loading branch information
loiswells97 committed Jul 9, 2025
commit 6856ea348a23c0f7378c49da3a52240e82749d71
4 changes: 2 additions & 2 deletions app/controllers/api/projects/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def update
@project = Project.find_by!(identifier: params[:project_id])
authorize! :update, @project

puts params[:image]
puts 'the filename is ' + params[:image].original_filename
Rails.logger.debug params[:image]
Rails.logger.debug { "the filename is #{params[:image].original_filename}" }
existing_image = @project.images.find { |i| i.blob.filename == params[:image].original_filename }
existing_image.purge
@project.images.attach(params[:image])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/projects/remixes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def remix_params
:videos,
:audio,
:instructions,
image_list: [:filename, :url, :content],
image_list: %i[filename url content],
components: %i[id name extension content index])
end
end
Expand Down
8 changes: 2 additions & 6 deletions lib/concepts/project/operations/create_remix.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'base64'

class Project
Expand Down Expand Up @@ -36,12 +37,7 @@ def create_remix(original_project, params, user_id, remix_origin)
remix.images.attach(image.blob)
end
params[:image_list].each do |image|
pp 'checking images'
pp image
if image[:content].present?
pp 'updating image'
remix.images.attach(io: StringIO.new(Base64.decode64(image[:content])), filename: image[:filename])
end
remix.images.attach(io: StringIO.new(Base64.decode64(image[:content])), filename: image[:filename]) if image[:content].present?
end

original_project.images.each do |image|
Expand Down