1
0

Test pass: test_index_options_add_exposure

This commit is contained in:
cryptogopher
2021-01-19 18:53:02 +01:00
parent 07eda42de4
commit 7d096748bf
7 changed files with 26 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ module Concerns::Finders
render_404
end
def find_goal_by_project_id
def find_binding_goal_by_project_id
@project = Project.find(params[:project_id])
@goal = @project.goals.binding
rescue ActiveRecord::RecordNotFound

View File

@@ -0,0 +1,12 @@
class GoalsController < ApplicationController
include Concerns::Finders
before_action :find_goal, only: [:show, :edit]
before_action :authorize
def show
end
def edit
end
end

View File

@@ -5,11 +5,13 @@ class TargetsController < ApplicationController
include Concerns::Finders
before_action :find_goal_by_project_id, only: [:index, :new, :edit]
before_action :find_binding_goal_by_project_id, only: [:index, :new, :edit]
before_action :find_project_by_project_id, only: [:create]
before_action :find_quantity_by_quantity_id, only: [:toggle_exposure]
#, if: ->{ params[:project_id].present? }
#before_action :find_goal, only: [:index, :new],
# unless: -> { @goal }
before_action :find_project_by_project_id, only: [:create]
before_action :find_goal, only: [:toggle_exposure]
before_action :authorize
#before_action :set_view_params