Skip to content

Commit

Permalink
Implement *_name methods to be used by Triggerable
Browse files Browse the repository at this point in the history
Instead of relaying on params to get those values, we rely on the
methods project_name and package_name from now on.
  • Loading branch information
saraycp authored and vpereira committed Sep 23, 2021
1 parent 7f51b0b commit 10fe29e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/api/app/controllers/trigger_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class TriggerController < ApplicationController

before_action :validate_gitlab_event, if: :gitlab_webhook?
before_action :set_token
before_action :set_project_name
before_action :set_package_name
# From Triggerable
before_action :set_project
before_action :set_package
before_action :set_object_to_authorize
Expand Down Expand Up @@ -64,4 +67,12 @@ def set_token
def pundit_user
@token.user
end

def set_project_name
@project_name = params[:project]
end

def set_package_name
@package_name = params[:package]
end
end

0 comments on commit 10fe29e

Please sign in to comment.