rails 5: controller s

refs CNVS-34864

Change-Id: I1e85486dc9398d0e2fcdf3ace66c9594e9528aea
Reviewed-on: https://gerrit.instructure.com/104190
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2017-03-06 17:39:43 -07:00
parent 6012a64ce7
commit 323683edcd
4 changed files with 18 additions and 9 deletions

View File

@ -31,7 +31,7 @@ class SelfEnrollmentsController < ApplicationController
if !@current_user && @domain_root_account.delegated_authentication? && !(params[:authentication_provider] == 'canvas')
store_location
return redirect_to login_url(params.slice(:authentication_provider))
return redirect_to login_url(params.permit(:authentication_provider))
end
end

View File

@ -20,7 +20,7 @@ module Submissions
include Submissions::ShowHelper
before_action :require_context
rescue_from ActiveRecord::RecordNotFound, only: :show, with: :render_user_not_found
rescue_from ActiveRecord::RecordNotFound, with: :render_user_not_found
def show
service = Submissions::SubmissionForShow.new(
@context, params.slice(:assignment_id, :id, :preview, :version)

View File

@ -103,13 +103,16 @@ class SubmissionsController < ApplicationController
end
end
rescue_from ActiveRecord::RecordNotFound, only: :show, with: :render_user_not_found
def show
service = Submissions::SubmissionForShow.new(
@context, params.slice(:assignment_id, :id)
)
@assignment = service.assignment
@submission = service.submission
begin
service = Submissions::SubmissionForShow.new(
@context, params.slice(:assignment_id, :id)
)
@assignment = service.assignment
@submission = service.submission
rescue ActiveRecord::RecordNotFound
return render_user_not_found
end
@rubric_association = @submission.rubric_association_with_assessing_user_id
@visible_rubric_assessments = @submission.visible_rubric_assessments_for(@current_user)

View File

@ -24,7 +24,13 @@ module ArbitraryStrongishParams
if filter[key] == ActionController::Parameters::EMPTY_ARRAY
# Declaration { comment_ids: [] }.
array_of_permitted_scalars_filter(params, key)
if CANVAS_RAILS4_2
array_of_permitted_scalars_filter(params, key)
else
array_of_permitted_scalars?(self[key]) do |val|
params[key] = val
end
end
elsif filter[key] == ANYTHING
if filtered = recursive_arbitrary_filter(value)
params[key] = filtered