app/controllers/notes_controller.rb
# Include noteable_id param in parent_params so that check_record can ensure that
# the noteable is in the same course as the current course
Include noteable_id param in parent_params so that check_record can ensure that
the noteable is in the same course as the current course
Include noteable_id param in parent_params so that check_record can ensure that the noteable is in the same course as the current course
def parent_params
    return super unless Note::NOTEABLES.include?(params[:noteable_type])
    noteable_id = params[:noteable_id] || params[:note]&.[](:noteable_id)
    return super unless noteable_id
    noteable_key = "#{params[:noteable_type].downcase}_id"
    params[noteable_key] = noteable_id
    [noteable_key, *super]
  end
def parent_params return super unless Note :: NOTEABLES . include? ( params [ :noteable_type ] ) noteable_id = params [ :noteable_id ] || params [ :note ] &. [] ( :noteable_id ) return super unless noteable_id noteable_key = "#{params[:noteable_type].downcase}_id" params [ noteable_key ] = noteable_id [ noteable_key , * super ] end
Include noteable_id param in parent_params so that check_record can ensure that
the noteable is in the same course as the current course
Include noteable_id param in parent_params so that check_record can ensure that the noteable is in the same course as the current course