adds consistency to ruby code style

Keep a blank line before and after private
Keep a blank line before and after protected
Remove extra empty line at class body end
Remove extra blank line
Add final newline
Use 2 (not 3) spaces for indentation
Use 2 (not 4) spaces for indentation
Remove space before comma
Add space after comma
Remove trailing whitespaces
Remove unnecessary spacing
Use snake_case for variable names
Do not use then for multi-line if
Remove unused block argument - i
Use the new Ruby 1.9 hash syntax
Remove unused assignment to variable
Indent when as deep as case
Align attributes
Align end with def
This commit is contained in:
rgarcia
2016-11-15 11:18:43 +01:00
parent f24ced329f
commit bb3c4c6399
85 changed files with 215 additions and 182 deletions

View File

@@ -6,6 +6,7 @@ class Management::AccountController < Management::BaseController
end
private
def only_verified_users
check_verified_user t("management.account.alert.unverified_user")
end

View File

@@ -3,4 +3,4 @@ class Management::DashboardController < Management::BaseController
def index
end
end
end

View File

@@ -33,17 +33,17 @@ class Management::DocumentVerificationsController < Management::BaseController
private
def document_verification_params
params.require(:document_verification).permit(:document_type, :document_number)
end
def document_verification_params
params.require(:document_verification).permit(:document_type, :document_number)
end
def set_document
session[:document_type] = params[:document_verification][:document_type]
session[:document_number] = params[:document_verification][:document_number]
end
def set_document
session[:document_type] = params[:document_verification][:document_type]
session[:document_number] = params[:document_verification][:document_number]
end
def clean_document_number
params[:document_verification][:document_number] = params[:document_verification][:document_number].gsub(/[^a-z0-9]+/i, "").upcase unless params[:document_verification][:document_number].blank?
end
def clean_document_number
params[:document_verification][:document_number] = params[:document_verification][:document_number].gsub(/[^a-z0-9]+/i, "").upcase unless params[:document_verification][:document_number].blank?
end
end

View File

@@ -16,8 +16,8 @@ class Management::EmailVerificationsController < Management::BaseController
private
def email_verification_params
params.require(:email_verification).permit(:document_type, :document_number, :email)
end
def email_verification_params
params.require(:email_verification).permit(:document_type, :document_number, :email)
end
end

View File

@@ -53,4 +53,4 @@ class Management::ProposalsController < Management::BaseController
@comment_flags = managed_user ? managed_user.comment_flags(comments) : {}
end
end
end

View File

@@ -42,4 +42,4 @@ class Management::SessionsController < ActionController::Base
end
end
end
end

View File

@@ -10,4 +10,4 @@ class Management::UserInvitesController < Management::BaseController
end
end
end
end