Merge branch 'master' into 'master'

Fix bug.

See merge request spen/seminar!42
This commit is contained in:
chiu 2022-06-08 13:20:47 +00:00
commit d88fe7f400
1 changed files with 14 additions and 13 deletions

View File

@ -533,23 +533,24 @@ class SeminarsController < ApplicationController
def update def update
@con = SeminarSignupContribute.find(params[:seminar_signup_contribute][:id]) @con = SeminarSignupContribute.find(params[:seminar_signup_contribute][:id])
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values']) update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
flag = true
update_params.permit! update_params.permit!
if update_params['seminar_submission_values']['0']['value'].class==String unless update_params['seminar_submission_values'].nil?
value = update_params['seminar_submission_values']['0']['value'] flag = true
if !value.to_s.blank? if update_params['seminar_submission_values']['0']['value'].class==String
flag = false value = update_params['seminar_submission_values']['0']['value']
end if !value.to_s.blank?
else
update_params['seminar_submission_values']['0']['value'].each do |key,value|
if !value.to_s.blank?
flag = false flag = false
end end
else
update_params['seminar_submission_values']['0']['value'].each do |key,value|
if !value.to_s.blank?
flag = false
end
end
end
if flag
update_params['seminar_submission_values']['0']['value']['en'] = ' '
end end
end
if flag
update_params['seminar_submission_values']['0']['value']['en'] = ' '
end end
@con.update_attributes(update_params) @con.update_attributes(update_params)
if @con.save if @con.save