From 1cc9550c800072d85195e6bff0cfdc0dd253aa53 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Fri, 2 Feb 2024 16:06:55 +0000 Subject: [PATCH 1/2] Lint files to rubocop omakase standards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit root ➜ /workspace (fix-rubocop-issues) $ rubocop Inspecting 54 files ...................................................... 54 files inspected, no offenses detected --- Gemfile | 6 +++--- app/controllers/application_controller.rb | 2 +- app/controllers/pages_controller.rb | 2 +- app/controllers/password_resets_controller.rb | 3 +-- app/controllers/passwords_controller.rb | 1 - app/controllers/registrations_controller.rb | 3 +-- app/controllers/sessions_controller.rb | 5 ++--- app/models/current.rb | 2 +- app/models/user.rb | 4 ++-- config/initializers/generator.rb | 2 +- 10 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index fbd13fe2..e6f509e3 100644 --- a/Gemfile +++ b/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 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2bfc19d9..c9ea07f8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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? diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 0534fc52..e6dc79ea 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,6 +1,6 @@ class PagesController < ApplicationController before_action :authenticate_user! - + def dashboard end end diff --git a/app/controllers/password_resets_controller.rb b/app/controllers/password_resets_controller.rb index aa7dc142..be83ec3a 100644 --- a/app/controllers/password_resets_controller.rb +++ b/app/controllers/password_resets_controller.rb @@ -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 - diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 2c7a9325..cf28c08e 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -18,4 +18,3 @@ class PasswordsController < ApplicationController params.require(:user).permit(:password, :password_confirmation, :password_challenge).with_defaults(password_challenge: "") end end - diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index b05379fe..cecad15a 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -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 - diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 711e1387..468ab024 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -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 - diff --git a/app/models/current.rb b/app/models/current.rb index 2d18a24e..73a9744b 100644 --- a/app/models/current.rb +++ b/app/models/current.rb @@ -1,3 +1,3 @@ class Current < ActiveSupport::CurrentAttributes attribute :user -end \ No newline at end of file +end diff --git a/app/models/user.rb b/app/models/user.rb index c2f72a03..5c8f05de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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) diff --git a/config/initializers/generator.rb b/config/initializers/generator.rb index 9dc40bc2..034fab6e 100644 --- a/config/initializers/generator.rb +++ b/config/initializers/generator.rb @@ -1,3 +1,3 @@ Rails.application.config.generators do |g| g.orm :active_record, primary_key_type: :uuid -end \ No newline at end of file +end From 005ea536b4f4d50d042e28d511f44758c9da9c07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:23:24 +0000 Subject: [PATCH 2/2] Bump brakeman from 6.1.1 to 6.1.2 Bumps [brakeman](https://github.com/presidentbeef/brakeman) from 6.1.1 to 6.1.2. - [Release notes](https://github.com/presidentbeef/brakeman/releases) - [Changelog](https://github.com/presidentbeef/brakeman/blob/main/CHANGES.md) - [Commits](https://github.com/presidentbeef/brakeman/compare/v6.1.1...v6.1.2) --- updated-dependencies: - dependency-name: brakeman dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8d37176e..d3f7d9f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -106,7 +106,7 @@ GEM bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) - brakeman (6.1.1) + brakeman (6.1.2) racc builder (3.2.4) capybara (3.40.0)