diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-28 01:40:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-28 01:40:43 +0300 |
commit | bbe511b231b5de3fab4dc418601c89cc1ccc8063 (patch) | |
tree | 650453c3b64751df39fda6f33ca4b39318f41e0d /app | |
parent | ad1c34c03de42ebc5279f338f6304e77930d34d4 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/application_dark.scss | 2 | ||||
-rw-r--r-- | app/models/application_setting/term.rb | 3 | ||||
-rw-r--r-- | app/services/application_settings/update_service.rb | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/stylesheets/application_dark.scss b/app/assets/stylesheets/application_dark.scss index 30db4e2296d..7d6ccc40278 100644 --- a/app/assets/stylesheets/application_dark.scss +++ b/app/assets/stylesheets/application_dark.scss @@ -58,7 +58,7 @@ body.gl-dark { } } - .md code { + .md :not(pre.code) > code { background-color: $gray-200; } } diff --git a/app/models/application_setting/term.rb b/app/models/application_setting/term.rb index acdd7e4155c..8910f22c502 100644 --- a/app/models/application_setting/term.rb +++ b/app/models/application_setting/term.rb @@ -3,13 +3,12 @@ class ApplicationSetting class Term < ApplicationRecord include CacheMarkdownField - include NullifyIfBlank has_many :term_agreements cache_markdown_field :terms - nullify_if_blank :terms + validates :terms, presence: true def self.latest order(:id).last diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb index 0f2099793ea..7728982779e 100644 --- a/app/services/application_settings/update_service.rb +++ b/app/services/application_settings/update_service.rb @@ -67,8 +67,10 @@ module ApplicationSettings end def update_terms(terms) + return unless terms.present? + # Avoid creating a new terms record if the text is exactly the same. - terms = terms&.strip + terms = terms.strip return if terms == @application_setting.terms ApplicationSetting::Term.create(terms: terms) |