From 4c7956ffa8f3326e4291fa0fc21883eff642beae Mon Sep 17 00:00:00 2001 From: Toru Takahashi Date: Wed, 23 May 2018 03:43:26 +0900 Subject: [PATCH] [bugfix]before calling authorize, should call find_project --- app/controllers/glossary_terms_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/glossary_terms_controller.rb b/app/controllers/glossary_terms_controller.rb index fe34678..4822091 100644 --- a/app/controllers/glossary_terms_controller.rb +++ b/app/controllers/glossary_terms_controller.rb @@ -1,9 +1,8 @@ class GlossaryTermsController < ApplicationController - before_action :authorize before_action :find_term_from_id, only: [:show, :edit, :update, :destroy] - before_action :find_project_from_id - + before_action :find_project_from_id, :authorize + def index @glossary_terms = GlossaryTerm.where(project_id: @project.id) @glossary_terms = @glossary_terms.search_by_name(params[:index]) unless params[:index].nil?