Use @project as default on ToggleSubscriptionAction concern

This commit is contained in:
Douglas Barbosa Alexandre 2016-11-03 11:09:38 -02:00
parent 4a29fde577
commit b3249bc28f
4 changed files with 1 additions and 13 deletions

View File

@ -12,7 +12,7 @@ module ToggleSubscriptionAction
private
def subscribable_project
raise NotImplementedError
@project || raise(NotImplementedError)
end
def subscribable_resource

View File

@ -169,10 +169,6 @@ class Projects::IssuesController < Projects::ApplicationController
alias_method :awardable, :issue
alias_method :spammable, :issue
def subscribable_project
issue.project
end
def authorize_read_issue!
return render_404 unless can?(current_user, :read_issue, @issue)
end

View File

@ -128,10 +128,6 @@ class Projects::LabelsController < Projects::ApplicationController
@available_labels.find(params[:id])
end
def subscribable_project
@project
end
def find_labels
@available_labels ||= LabelsFinder.new(current_user, project_id: @project.id).execute
end

View File

@ -473,10 +473,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
alias_method :issuable, :merge_request
alias_method :awardable, :merge_request
def subscribable_project
merge_request.project
end
def authorize_update_merge_request!
return render_404 unless can?(current_user, :update_merge_request, @merge_request)
end