Test pass: test_index_options_add_exposure
This commit is contained in:
@@ -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
|
||||
|
||||
12
app/controllers/goals_controller.rb
Normal file
12
app/controllers/goals_controller.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user