save settings from basil properly

This commit is contained in:
Andrew Brown 2023-03-02 19:23:16 -08:00
parent 83b2514f4e
commit 952168aaeb
2 changed files with 11 additions and 4 deletions

View File

@ -185,9 +185,11 @@ class BasilController < ApplicationController
def complete_commission
commission = BasilCommission.find_by(job_id: params[:jobid])
return if commission.nil?
commission.update(
completed_at: DateTime.current,
final_settings: params[:settings]
final_settings: JSON.parse(params.fetch(:settings, {}))
)
# TODO: we should attach the S3 object to the commission.image attachment

View File

@ -1,3 +1,8 @@
# TODO we can probably remove this. Need to figure out what we're using for uploads again.
# Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
# We don't want to use Paperclip forever, but we're adding the following interpolater
# to enable attaching images that are already in S3 (created by Basil) and we haven't
# migrated to ActiveStorage yet so... here we are.
# JK LOL THIS DOESN'T EVEN WORK SO FEEL FREE TO DELETE AT WILL
# Paperclip.interpolates :src_or_default do |attachment, style|
# attachment.instance.src_path ||
# attachment.interpolator.interpolate(":class/:attachment/:id_partition/:style/:filename", attachment, style)
# end