Skip to content

Commit

Permalink
(bug) unable to show gender in global export
Browse files Browse the repository at this point in the history
  • Loading branch information
gnepud committed Jul 4, 2024
1 parent 04d6d24 commit 1e69a1e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Next release

- Fix a bug: unable to show gender in global export

## v6.3.27 2024 June 12

- Fix a bug: unable to show gender wowan in member export
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/excel_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def statistics_line(hit, user, type, subtype, date_format)
user&.profile&.full_name || t('export.deleted_user'),
user&.email || '',
user&.profile&.phone || '',
hit['_source']['gender'].nil? ? t("export.#{hit['_source']['gender']}") : '',
!hit['_source']['gender'].nil? ? t("export.#{hit['_source']['gender']}") : '',
hit['_source']['age'],
subtype.nil? ? '' : subtype.label
]
Expand Down
2 changes: 1 addition & 1 deletion app/models/statistic_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class StatisticProfile < ApplicationRecord
validate :check_birthday_in_past

def str_gender
return '' if gender.blank?
return '' if gender.nil?

gender ? 'male' : 'female'
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/exports/users_members.xlsx.axlsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ wb.add_worksheet(name: ExcelService.name_safe(t('export_members.members'))) do |
member.email,
member.is_allow_newsletter,
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.invoicing_profile&.address&.address || '',
member.profile.phone,
Expand Down

0 comments on commit 1e69a1e

Please sign in to comment.