Fix error when terms of service are missing an effective date (#34200)
This commit is contained in:
parent
547658f086
commit
0099907600
2 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ class REST::TermsOfServiceSerializer < ActiveModel::Serializer
|
||||||
attributes :effective_date, :effective, :content, :succeeded_by
|
attributes :effective_date, :effective, :content, :succeeded_by
|
||||||
|
|
||||||
def effective_date
|
def effective_date
|
||||||
object.effective_date.iso8601
|
(object.effective_date || object.published_at).iso8601
|
||||||
end
|
end
|
||||||
|
|
||||||
def effective
|
def effective
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
.dot-indicator.success
|
.dot-indicator.success
|
||||||
.dot-indicator__indicator
|
.dot-indicator__indicator
|
||||||
%span
|
%span
|
||||||
- if @terms_of_service.effective?
|
- if @terms_of_service.effective? || @terms_of_service.effective_date.nil?
|
||||||
= t('admin.terms_of_service.live')
|
= t('admin.terms_of_service.live')
|
||||||
- else
|
- else
|
||||||
= t('admin.terms_of_service.going_live_on_html', date: tag.time(l(@terms_of_service.effective_date), class: 'formatted', date: @terms_of_service.effective_date.iso8601))
|
= t('admin.terms_of_service.going_live_on_html', date: tag.time(l(@terms_of_service.effective_date), class: 'formatted', date: @terms_of_service.effective_date.iso8601))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue