diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-12 06:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-12 06:09:27 +0300 |
commit | 39623d60e828f0d9e2d9c96fa5adfc420808f454 (patch) | |
tree | 69abb57cb958e3c8f6e279c9adb26db10184444d /app/models/application_setting | |
parent | 5da9546a43ffba2fabdd87c7abcf1a32e2ed0965 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/application_setting')
-rw-r--r-- | app/models/application_setting/term.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/application_setting/term.rb b/app/models/application_setting/term.rb index bab036f5697..acdd7e4155c 100644 --- a/app/models/application_setting/term.rb +++ b/app/models/application_setting/term.rb @@ -3,12 +3,14 @@ class ApplicationSetting class Term < ApplicationRecord include CacheMarkdownField - has_many :term_agreements + include NullifyIfBlank - validates :terms, presence: true + has_many :term_agreements cache_markdown_field :terms + nullify_if_blank :terms + def self.latest order(:id).last end |