fix export error
This commit is contained in:
parent
f4c7be63c9
commit
9243160b70
|
@ -437,7 +437,7 @@ class Admin::AsksController < OrbitAdminController
|
|||
end
|
||||
def get_fields_with_key(s)
|
||||
fields_with_key = {}
|
||||
fields_with_key['default_values'] = s.default_setting.collect{|k,v| [k, process_trans(s.field_name_translations(k))] if v && k!='ask_category_id'}.compact
|
||||
fields_with_key['default_values'] = s.default_setting.collect{|k,v| [k, process_trans(s.field_name_translations(k))] if v && !['ask_category_id','recaptcha'].include?(k)}.compact
|
||||
fields_with_key['default_values'] = [['ask_category_id', process_trans(s.field_name_translations('ask_category_id'))]] + fields_with_key['default_values']
|
||||
fields_with_key['default_values'] = fields_with_key['default_values'].to_h
|
||||
fields_with_key['custom_values'] = s.custom_fields.collect{|k, field_setting| [k, process_trans(field_setting['field'])]}.to_h
|
||||
|
|
|
@ -27,7 +27,7 @@ wb.add_worksheet(name: "Ask Question") do |sheet|
|
|||
when 'title','name','mail','phone','appointment'
|
||||
text = ask_question.send(key).to_s
|
||||
when 'ask_category_id'
|
||||
text = categories[ask_question.ask_category_id].title rescue ''
|
||||
text = categories[ask_question.category_id].title rescue ''
|
||||
when 'sex'
|
||||
text = ask_question.sex
|
||||
if ['male','female'].include? sex.to_s
|
||||
|
|
Loading…
Reference in New Issue