GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Extract new list position validation to a method

parent 22b8c0b7
......@@ -8,10 +8,7 @@ def initialize(project, params = {})
def execute
return false unless list.label?
return false if new_position.blank?
return false if new_position == old_position
return false if new_position == first_position
return false if new_position == last_position
return false if invalid_position?
list.with_lock do
......@@ -27,6 +24,12 @@ def list
@list ||= board.lists.find(params[:list_id])
def invalid_position?
return true if new_position.blank?
[old_position, first_position, last_position].include?(new_position)
def first_position
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment