feat(i18n): expose locale on dossier and deleted_dossier

This commit is contained in:
Paul Chavard 2021-09-01 18:17:26 +02:00
parent f1ff6da81b
commit ff7fa4d895
2 changed files with 8 additions and 0 deletions

View file

@ -47,4 +47,8 @@ class DeletedDossier < ApplicationRecord
def procedure_removed? def procedure_removed?
reason == self.class.reasons.fetch(:procedure_removed) reason == self.class.reasons.fetch(:procedure_removed)
end end
def user_locale
User.find_by(id: user_id)&.locale || I18n.default_locale
end
end end

View file

@ -921,6 +921,10 @@ class Dossier < ApplicationRecord
update_column(:api_entreprise_job_exceptions, exceptions) update_column(:api_entreprise_job_exceptions, exceptions)
end end
def user_locale
user&.locale || I18n.default_locale
end
private private
def defaut_groupe_instructeur? def defaut_groupe_instructeur?