Fix database error instead of form validation on ToS effective date conflict (#35053)
This commit is contained in:
parent
ca3cc36549
commit
c644413f8a
1 changed files with 1 additions and 0 deletions
|
@ -20,6 +20,7 @@ class TermsOfService < ApplicationRecord
|
||||||
|
|
||||||
validates :text, presence: true
|
validates :text, presence: true
|
||||||
validates :changelog, :effective_date, presence: true, if: -> { published? }
|
validates :changelog, :effective_date, presence: true, if: -> { published? }
|
||||||
|
validates :effective_date, uniqueness: true
|
||||||
|
|
||||||
validate :effective_date_cannot_be_in_the_past
|
validate :effective_date_cannot_be_in_the_past
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue