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/snippet_input_action.rb')
-rw-r--r--app/models/snippet_input_action.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/snippet_input_action.rb b/app/models/snippet_input_action.rb
index cc6373264cc..b5362b5c14e 100644
--- a/app/models/snippet_input_action.rb
+++ b/app/models/snippet_input_action.rb
@@ -15,7 +15,7 @@ class SnippetInputAction
validates :action, inclusion: { in: ACTIONS, message: "%{value} is not a valid action" }
validates :previous_path, presence: true, if: :move_action?
- validates :file_path, presence: true, unless: :create_action?
+ validates :file_path, presence: true, if: -> (action) { action.update_action? || action.delete_action? }
validates :content, presence: true, if: -> (action) { action.create_action? || action.update_action? }
validate :ensure_same_file_path_and_previous_path, if: :update_action?
validate :ensure_different_file_path_and_previous_path, if: :move_action?