feat(cops): clean rubocop run

1. ignoring one file because it's an intentional vuln
2. made a few small semantic changes, but verified that they're equivalent.
This commit is contained in:
Joseph Mastey
2017-12-06 17:14:25 -06:00
parent 9902345291
commit 6e0a0a8312
11 changed files with 40 additions and 27 deletions
+1 -2
View File
@@ -2,6 +2,7 @@
class AdminController < ApplicationController
before_action :administrative, if: :admin_param, except: [:get_user]
skip_before_action :has_info
layout false, only: [:get_all_users, :get_user]
def dashboard
end
@@ -22,14 +23,12 @@ class AdminController < ApplicationController
def get_all_users
@users = User.all
render layout: false
end
def get_user
@user = User.find_by_id(params[:admin_id].to_s)
arr = ["true", "false"]
@admin_select = @user.admin ? arr : arr.reverse
render layout: false
end
def update_user
+7 -9
View File
@@ -1,6 +1,7 @@
# frozen_string_literal: true
class DashboardController < ApplicationController
skip_before_action :has_info
layout false, only: [:change_graph]
def home
@user = current_user
@@ -13,15 +14,12 @@ class DashboardController < ApplicationController
def change_graph
self.try(params[:graph])
end
def bar_graph
render :bar_graph, layout: false
if params[:graph] == "bar_graph"
render "dashboard/bar_graph"
else
@user = current_user
render "dashboard/pie_charts"
end
end
def pie_charts
@user = current_user
render :dashboard_stats, layout: false
end
end
@@ -19,7 +19,7 @@ class PasswordResetsController < ApplicationController
def confirm_token
if !params[:token].nil? && is_valid?(params[:token])
flash[:success] = "Password reset token confirmed! Please create a new password."
render "reset_password"
render "password_resets/reset_password"
else
flash[:error] = "Invalid password reset token. Please try again."
redirect_to :login
+1 -1
View File
@@ -33,7 +33,7 @@ class ScheduleController < ApplicationController
end
rescue
end
respond_to do |format|
respond_to do |format|
format.json { render json: jfs.to_json }
end
end
+3 -2
View File
@@ -13,7 +13,8 @@ class SessionsController < ApplicationController
begin
# Normalize the email address, why not
user = User.authenticate(params[:email].to_s.downcase, params[:password])
rescue Exception => e
rescue RuntimeError => e
# don't do ANYTHING
end
if user
@@ -25,7 +26,7 @@ class SessionsController < ApplicationController
redirect_to path
else
flash[:error] = e.message
render "new"
render "sessions/new"
end
end
+1 -4
View File
@@ -3,8 +3,5 @@ class TutorialsController < ApplicationController
skip_before_action :has_info
skip_before_action :authenticated
def credentials
render layout: false
end
layout false, only: [:credentials]
end