Skip to content

Commit

Permalink
Use Project#get_by_name instead of #find_by in Staging
Browse files Browse the repository at this point in the history
Staging::StagingProject is a subclass of Project. `get_by_name` should
be used always that a project is required instead of `find_by!` as it
considers more cases where an exception should be raised.
  • Loading branch information
Ana06 committed Nov 22, 2018
1 parent 53eb602 commit 346287a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def request_numbers
end

def set_staging_project
@staging_project = Staging::StagingProject.find_by!(name: params[:staging_project_name])
@staging_project = Staging::StagingProject.get_by_name(params[:staging_project_name])
end

def set_staging_workflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class Staging::StagingProjectsController < ApplicationController
skip_before_action :require_login

def show
@staging_project = Staging::StagingProject.find_by!(name: params[:name])
@staging_project = Staging::StagingProject.get_by_name(params[:name])
end
end

0 comments on commit 346287a

Please sign in to comment.