mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
Lint files to rubocop omakase standards
root ➜ /workspace (fix-rubocop-issues) $ rubocop Inspecting 54 files ...................................................... 54 files inspected, no offenses detected
This commit is contained in:
parent
9014c8e615
commit
1cc9550c80
10 changed files with 13 additions and 17 deletions
6
Gemfile
6
Gemfile
|
@ -32,10 +32,10 @@ gem "jbuilder"
|
|||
# Use Redis adapter to run Action Cable in production
|
||||
gem "redis", ">= 4.0.1"
|
||||
|
||||
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
|
||||
# gem "kredis"
|
||||
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
|
||||
# gem "kredis"
|
||||
|
||||
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
|
||||
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
|
||||
gem "bcrypt", "~> 3.1.7"
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
|
|
|
@ -15,7 +15,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def authenticate_user_from_session
|
||||
User.find_by(id: session[:user_id])
|
||||
end
|
||||
end
|
||||
|
||||
def user_signed_in?
|
||||
current_user.present?
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class PagesController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
|
||||
|
||||
def dashboard
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class PasswordResetsController < ApplicationController
|
||||
layout "auth"
|
||||
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
|
@ -37,4 +37,3 @@ class PasswordResetsController < ApplicationController
|
|||
params.require(:user).permit(:password, :password_confirmation)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ class PasswordsController < ApplicationController
|
|||
params.require(:user).permit(:password, :password_confirmation, :password_challenge).with_defaults(password_challenge: "")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class RegistrationsController < ApplicationController
|
||||
layout "auth"
|
||||
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
end
|
||||
|
@ -27,4 +27,3 @@ class RegistrationsController < ApplicationController
|
|||
params.require(:user).permit(:name, :email, :password, :password_confirmation)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class SessionsController < ApplicationController
|
||||
layout "auth"
|
||||
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
|
@ -13,10 +13,9 @@ class SessionsController < ApplicationController
|
|||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
logout
|
||||
redirect_to root_path, notice: "You have signed out successfully."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
class Current < ActiveSupport::CurrentAttributes
|
||||
attribute :user
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
class User < ApplicationRecord
|
||||
has_secure_password
|
||||
|
||||
|
||||
belongs_to :family
|
||||
|
||||
validates :email, presence: true, uniqueness: true
|
||||
normalizes :email, with: -> (email) { email.strip.downcase }
|
||||
normalizes :email, with: ->(email) { email.strip.downcase }
|
||||
|
||||
generates_token_for :password_reset, expires_in: 15.minutes do
|
||||
password_salt&.last(10)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Rails.application.config.generators do |g|
|
||||
g.orm :active_record, primary_key_type: :uuid
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue