From 1019dff2371b30979b33ce823abeadadad9cfab3 Mon Sep 17 00:00:00 2001 From: Chantal Rollison Date: Wed, 2 May 2018 14:34:05 -0700 Subject: Backport of 1481-changing-weight-values-should-trigger-system-notes --- app/controllers/concerns/issuable_actions.rb | 1 - app/models/system_note_metadata.rb | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb index 0379f76fc3d..c925b4aada5 100644 --- a/app/controllers/concerns/issuable_actions.rb +++ b/app/controllers/concerns/issuable_actions.rb @@ -18,7 +18,6 @@ module IssuableActions def update @issuable = update_service.execute(issuable) # rubocop:disable Gitlab/ModuleWithInstanceVariables - respond_to do |format| format.html do recaptcha_check_if_spammable { render :edit } diff --git a/app/models/system_note_metadata.rb b/app/models/system_note_metadata.rb index 29035480371..1c2161accc4 100644 --- a/app/models/system_note_metadata.rb +++ b/app/models/system_note_metadata.rb @@ -17,7 +17,11 @@ class SystemNoteMetadata < ActiveRecord::Base ].freeze validates :note, presence: true - validates :action, inclusion: ICON_TYPES, allow_nil: true + validates :action, inclusion: { in: :icon_types }, allow_nil: true belongs_to :note + + def icon_types + ICON_TYPES + end end -- cgit v1.2.1