chore(rubocop): giganto rubocop commit.
muahahahah
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
class AdminController < ApplicationController
|
||||
before_action :administrative, :if => :admin_param, :except => [:get_user]
|
||||
before_action :administrative, if: :admin_param, except: [:get_user]
|
||||
skip_before_action :has_info
|
||||
|
||||
def dashboard
|
||||
@@ -41,7 +42,7 @@ class AdminController < ApplicationController
|
||||
message = true
|
||||
end
|
||||
respond_to do |format|
|
||||
format.json { render :json => { :msg => message ? "success" : "failure"} }
|
||||
format.json { render json: { msg: message ? "success" : "failure"} }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,7 +55,7 @@ class AdminController < ApplicationController
|
||||
message = true
|
||||
end
|
||||
respond_to do |format|
|
||||
format.json { render :json => { :msg => message ? "success" : "failure"} }
|
||||
format.json { render json: { msg: message ? "success" : "failure"} }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,6 +67,6 @@ class AdminController < ApplicationController
|
||||
helper_method :custom_fields
|
||||
|
||||
def admin_param
|
||||
params[:admin_id] != '1'
|
||||
params[:admin_id] != "1"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class Api::V1::MobileController < ApplicationController
|
||||
skip_before_action :authenticated
|
||||
before_action :mobile_request?
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class Api::V1::UsersController < ApplicationController
|
||||
skip_before_action :authenticated
|
||||
before_action :valid_api_token
|
||||
@@ -24,7 +25,7 @@ class Api::V1::UsersController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def identify_user(token="")
|
||||
def identify_user(token = "")
|
||||
# We've had issues with URL encoding, etc. causing issues so just to be safe
|
||||
# we will go ahead and unescape the user's token
|
||||
unescape_token(token)
|
||||
@@ -42,7 +43,7 @@ class Api::V1::UsersController < ApplicationController
|
||||
|
||||
# We had some issues with the token and url encoding...
|
||||
# this is an attempt to normalize the data.
|
||||
def unescape_token(token="")
|
||||
def unescape_token(token = "")
|
||||
@clean_token = CGI::unescape(token)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class ApplicationController < ActionController::Base
|
||||
before_action :authenticated, :has_info, :create_analytic, :mailer_options
|
||||
helper_method :current_user, :is_admin?, :sanitize_font
|
||||
@@ -22,8 +23,8 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def authenticated
|
||||
path = request.fullpath.present? ? root_url(:url => request.fullpath) : root_url
|
||||
redirect_to path and reset_session if not current_user
|
||||
path = request.fullpath.present? ? root_url(url: request.fullpath) : root_url
|
||||
redirect_to path and reset_session if !current_user
|
||||
end
|
||||
|
||||
def is_admin?
|
||||
@@ -31,7 +32,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def administrative
|
||||
if not is_admin?
|
||||
if !is_admin?
|
||||
redirect_to root_url
|
||||
end
|
||||
end
|
||||
@@ -51,7 +52,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def create_analytic
|
||||
Analytics.create({ :ip_address => request.remote_ip, :referrer => request.referrer, :user_agent => request.user_agent})
|
||||
Analytics.create({ ip_address: request.remote_ip, referrer: request.referrer, user_agent: request.user_agent})
|
||||
end
|
||||
|
||||
def sanitize_font(css)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class BenefitFormsController < ApplicationController
|
||||
|
||||
def index
|
||||
@@ -8,9 +9,9 @@ class BenefitFormsController < ApplicationController
|
||||
begin
|
||||
path = params[:name]
|
||||
file = params[:type].constantize.new(path)
|
||||
send_file file, :disposition => 'attachment'
|
||||
send_file file, disposition: "attachment"
|
||||
rescue
|
||||
redirect_to user_benefit_forms_path(:user_id => current_user.user_id)
|
||||
redirect_to user_benefit_forms_path(user_id: current_user.user_id)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +23,7 @@ class BenefitFormsController < ApplicationController
|
||||
else
|
||||
flash[:error] = "Something went wrong"
|
||||
end
|
||||
redirect_to user_benefit_forms_path(:user_id => current_user.user_id)
|
||||
redirect_to user_benefit_forms_path(user_id: current_user.user_id)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class DashboardController < ApplicationController
|
||||
skip_before_action :has_info
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class MessagesController < ApplicationController
|
||||
|
||||
def index
|
||||
@@ -7,15 +8,15 @@ class MessagesController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@message = Message.where(:id => params[:id]).first
|
||||
@message = Message.where(id: params[:id]).first
|
||||
end
|
||||
|
||||
def destroy
|
||||
message = Message.where(:id => params[:id]).first
|
||||
message = Message.where(id: params[:id]).first
|
||||
|
||||
if message.destroy
|
||||
flash[:success] = "Your message has been deleted."
|
||||
redirect_to user_messages_path(:user_id => current_user.user_id)
|
||||
redirect_to user_messages_path(user_id: current_user.user_id)
|
||||
else
|
||||
flash[:error] = "Could not delete message."
|
||||
end
|
||||
@@ -24,13 +25,13 @@ class MessagesController < ApplicationController
|
||||
def create
|
||||
if Message.create(message_params)
|
||||
respond_to do |format|
|
||||
format.html { redirect_to user_messages_path(:user_id => current_user.user_id) }
|
||||
format.json { render :json => {:msg => "success"} }
|
||||
format.html { redirect_to user_messages_path(user_id: current_user.user_id) }
|
||||
format.json { render json: {msg: "success"} }
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html { redirect_to user_messages_path }
|
||||
format.json { render :json => {:msg => "failure"} }
|
||||
format.json { render json: {msg: "failure"} }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class PaidTimeOffController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class PasswordResetsController < ApplicationController
|
||||
skip_before_action :authenticated
|
||||
|
||||
@@ -18,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 "reset_password"
|
||||
else
|
||||
flash[:error] = "Invalid password reset token. Please try again."
|
||||
redirect_to :login
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class PayController < ApplicationController
|
||||
|
||||
def index
|
||||
@@ -6,20 +7,20 @@ class PayController < ApplicationController
|
||||
def update_dd_info
|
||||
msg = false
|
||||
pay = Pay.new(
|
||||
:bank_account_num => params[:bank_account_num],
|
||||
:bank_routing_num => params[:bank_routing_num],
|
||||
:percent_of_deposit => params[:dd_percent]
|
||||
bank_account_num: params[:bank_account_num],
|
||||
bank_routing_num: params[:bank_routing_num],
|
||||
percent_of_deposit: params[:dd_percent]
|
||||
)
|
||||
pay.user_id = current_user.user_id
|
||||
msg = true if pay.save!
|
||||
respond_to do |format|
|
||||
format.json {render :json => {:msg => msg } }
|
||||
format.json {render json: {msg: msg } }
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
respond_to do |format|
|
||||
format.json { render :json => {:user => current_user.pay.as_json} }
|
||||
format.json { render json: {user: current_user.pay.as_json} }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,7 +37,7 @@ class PayController < ApplicationController
|
||||
def decrypted_bank_acct_num
|
||||
decrypted = Encryption.decrypt_sensitive_value(params[:value_to_decrypt])
|
||||
respond_to do |format|
|
||||
format.json {render :json => {:account_num => decrypted || "No Data" }}
|
||||
format.json {render json: {account_num: decrypted || "No Data" }}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class PerformanceController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class RetirementController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class ScheduleController < ApplicationController
|
||||
|
||||
def create
|
||||
@@ -14,7 +15,7 @@ class ScheduleController < ApplicationController
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.json {render :json => {:msg => message ? "success" : "failure" }}
|
||||
format.json {render json: {msg: message ? "success" : "failure" }}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,11 +34,9 @@ class ScheduleController < ApplicationController
|
||||
rescue
|
||||
end
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render :json => jfs.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
format.json { render json: jfs.to_json }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -47,8 +46,8 @@ class ScheduleController < ApplicationController
|
||||
begin
|
||||
vals = []
|
||||
return vals if date_array.empty?
|
||||
date_array.split('-').each do |s|
|
||||
date = Date.strptime(s.strip, '%m/%d/%Y')
|
||||
date_array.split("-").each do |s|
|
||||
date = Date.strptime(s.strip, "%m/%d/%Y")
|
||||
vals <<(date)
|
||||
end
|
||||
rescue ArgumentError
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
class SessionsController < ApplicationController
|
||||
skip_before_action :has_info
|
||||
skip_before_action :authenticated, :only => [:new, :create]
|
||||
skip_before_action :authenticated, only: [:new, :create]
|
||||
|
||||
def new
|
||||
@url = params[:url]
|
||||
@@ -17,9 +18,9 @@ class SessionsController < ApplicationController
|
||||
|
||||
if user
|
||||
if params[:remember_me]
|
||||
cookies.permanent[:auth_token] = user.auth_token if User.where(:user_id => user.user_id).exists?
|
||||
cookies.permanent[:auth_token] = user.auth_token if User.where(user_id: user.user_id).exists?
|
||||
else
|
||||
session[:user_id] = user.user_id if User.where(:user_id => user.user_id).exists?
|
||||
session[:user_id] = user.user_id if User.where(user_id: user.user_id).exists?
|
||||
end
|
||||
redirect_to path
|
||||
else
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class TutorialsController < ApplicationController
|
||||
skip_before_action :has_info
|
||||
skip_before_action :authenticated
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
class UsersController < ApplicationController
|
||||
skip_before_action :has_info
|
||||
skip_before_action :authenticated, :only => [:new, :create]
|
||||
skip_before_action :authenticated, only: [:new, :create]
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
@@ -35,12 +36,12 @@ class UsersController < ApplicationController
|
||||
end
|
||||
message = true if user.save!
|
||||
respond_to do |format|
|
||||
format.html { redirect_to user_account_settings_path(:user_id => current_user.user_id) }
|
||||
format.json { render :json => {:msg => message ? "success" : "false "} }
|
||||
format.html { redirect_to user_account_settings_path(user_id: current_user.user_id) }
|
||||
format.json { render json: {msg: message ? "success" : "false "} }
|
||||
end
|
||||
else
|
||||
flash[:error] = "Could not update user!"
|
||||
redirect_to user_account_settings_path(:user_id => current_user.user_id)
|
||||
redirect_to user_account_settings_path(user_id: current_user.user_id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class WorkInfoController < ApplicationController
|
||||
def index
|
||||
@user = User.find_by_user_id(params[:user_id])
|
||||
|
||||
Reference in New Issue
Block a user