Skip to content

Commit

Permalink
Fix regex match group handling after moving to case statements
Browse files Browse the repository at this point in the history
  • Loading branch information
krauselukas committed Jul 16, 2020
1 parent 0fb892f commit 876d92c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/app/controllers/webui/repositories_controller.rb
Expand Up @@ -197,9 +197,9 @@ def follow_change_flag_command(flag_type)
case params[:command]
when 'remove'
@main_object.flags.of_type(flag_type).where(repo: params[:repository], architecture: architecture).delete_all
when %r{^set-(?<status>disable|enable)$}
when /^set-(?<status>disable|enable)$/
flag = @main_object.flags.find_or_create_by(flag: flag_type, repo: params[:repository], architecture: architecture)
flag.update(status: status)
flag.update(status: $LAST_MATCH_INFO['status'])
end
@main_object.store
end
Expand Down

0 comments on commit 876d92c

Please sign in to comment.