Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/application_setting/term.rb')
-rw-r--r--app/models/application_setting/term.rb6
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