From 92bbcb9dbddfbf29d1a01293a36f8600d0c813b9 Mon Sep 17 00:00:00 2001 From: Elson Otake Date: Mon, 22 Sep 2025 23:36:43 -0300 Subject: [PATCH] Add ostruct gem and fix Rails 8 secrets deprecation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ostruct gem for Ruby 3.5+ compatibility - Fix JsonWebToken to use Rails.application.secret_key_base instead of deprecated Rails.application.secrets 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Gemfile | 3 +++ Gemfile.lock | 2 ++ app/models/json_web_token.rb | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index b167967a..c4e3c256 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,9 @@ gem 'rubocop', '>= 1.58', '< 2.0' # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem 'rails', '~> 8.0.0' +# Required for Ruby 3.5+ compatibility +gem 'ostruct' + # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 901ce6a2..6a35b137 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -262,6 +262,7 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) + ostruct (0.6.3) pagy (6.0.4) parallel (1.27.0) parser (3.3.9.0) @@ -484,6 +485,7 @@ DEPENDENCIES omniauth-github (~> 2.0.0) omniauth-google-oauth2 omniauth-rails_csrf_protection + ostruct pagy (~> 6.0) pg (~> 1.1) puma (~> 6.0) diff --git a/app/models/json_web_token.rb b/app/models/json_web_token.rb index e7767366..a336dff7 100644 --- a/app/models/json_web_token.rb +++ b/app/models/json_web_token.rb @@ -1,5 +1,5 @@ class JsonWebToken - SECRET_KEY = Rails.application.secrets.secret_key_base.to_s + SECRET_KEY = Rails.application.secret_key_base.to_s def self.encode(payload, exp = 24.hours.from_now) payload[:exp] = exp.to_i