1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) unable to show gender in global export

This commit is contained in:
Du Peng 2024-07-04 18:16:39 +02:00
parent 04d6d24a8a
commit 1e69a1eb37
4 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,8 @@
## Next release ## Next release
- Fix a bug: unable to show gender in global export
## v6.3.27 2024 June 12 ## v6.3.27 2024 June 12
- Fix a bug: unable to show gender wowan in member export - Fix a bug: unable to show gender wowan in member export

View File

@ -31,7 +31,7 @@ module ExcelHelper
user&.profile&.full_name || t('export.deleted_user'), user&.profile&.full_name || t('export.deleted_user'),
user&.email || '', user&.email || '',
user&.profile&.phone || '', user&.profile&.phone || '',
hit['_source']['gender'].nil? ? t("export.#{hit['_source']['gender']}") : '', !hit['_source']['gender'].nil? ? t("export.#{hit['_source']['gender']}") : '',
hit['_source']['age'], hit['_source']['age'],
subtype.nil? ? '' : subtype.label subtype.nil? ? '' : subtype.label
] ]

View File

@ -31,7 +31,7 @@ class StatisticProfile < ApplicationRecord
validate :check_birthday_in_past validate :check_birthday_in_past
def str_gender def str_gender
return '' if gender.blank? return '' if gender.nil?
gender ? 'male' : 'female' gender ? 'male' : 'female'
end end

View File

@ -51,7 +51,7 @@ wb.add_worksheet(name: ExcelService.name_safe(t('export_members.members'))) do |
member.email, member.email,
member.is_allow_newsletter, member.is_allow_newsletter,
member.last_sign_in_at&.to_date, member.last_sign_in_at&.to_date,
member.statistic_profile.gender.nil? ? (member.statistic_profile.gender ? t('export_members.man') : t('export_members.woman')) : '', !member.statistic_profile.gender.nil? ? (member.statistic_profile.gender ? t('export_members.man') : t('export_members.woman')) : '',
member.statistic_profile.age, member.statistic_profile.age,
member.invoicing_profile&.address&.address || '', member.invoicing_profile&.address&.address || '',
member.profile.phone, member.profile.phone,