Skip to content

Update ruby rails #807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

Update ruby rails #807

wants to merge 23 commits into from

Conversation

elg0nz
Copy link

@elg0nz elg0nz commented Jun 15, 2025

What github issue is this PR for, if any?

Resolves #1

What does this code do, and why?

How is this code tested?

Are any database migrations required by this change?

Are there any configuration or environment changes needed?

Screenshots please :)

elg0nz and others added 15 commits May 20, 2025 14:53
Here's a summary of the changes:
- Ruby has been updated from version 2.7.7 to 3.2.8.
- Rails has been updated from approximately version 6.0 to approximately 8.0.2.
- I moved StripeEventHelper to lib/stripe_event_handlers. This was done to resolve a NameError that appeared after the Rails update, as initializers now run before helpers are typically loaded, and the lib directory is autoloaded.

Please note that further testing and running `rails app:update` couldn't be completed due to the current environment's limitations. You'll need to perform these steps manually in your local environment.
…-rails-upgrade

# Conflicts:
#	.ruby-version
#	Gemfile.lock
#	config/application.rb
This involves adding the `.github/workflows/ruby-ci.yml` file to this branch to enable CI runs.

The workflow is configured to:
- Trigger on pushes to all branches and PRs to main.
- Use Ruby 3.2.8.
- Cache Bundler dependencies.
- Set up the test database using PostgreSQL.
- Run RSpec tests.
Adds a direct `require 'stripe_event_handlers/stripe_event_helper'`
to the beginning of `config/initializers/stripe.rb`.

This is to resolve a `NameError: uninitialized constant StripeEventHelper`
that was occurring during CI runs (specifically during `db:create` or
`db:schema:load` which run initializers). While autoloading for `lib`
is configured, this explicit require ensures the helper is available
when the Stripe events are being subscribed, avoiding potential load
order issues in the Rake task execution context.
Removes the `protected_attributes_continued` gem to resolve a
`TypeError: superclass mismatch for class SchemaMigration` error
encountered during CI when running `db:create` or `db:schema:load`.

This gem is incompatible with Rails 8 and was used for `attr_accessible`
functionality, which is replaced by Strong Parameters in modern Rails.
Occurrences of `attr_accessible` were found in User and Authentication
models; these will now rely on controller-level Strong Parameters.

Note: `Gemfile.lock` was not updated by `bundle install` due to a persistent sandbox error. The CI environment or a local `bundle install` run should correctly update the lockfile based on this Gemfile change.
I've implemented a more comprehensive .devcontainer configuration using
a custom Dockerfile and Docker Compose to define your development
environment.

This setup includes:
- `.devcontainer/Dockerfile`: This defines the application environment
  starting from Ruby 3.2.8, installs system dependencies (PostgreSQL client,
  Node.js, Yarn), creates a non-root user, and handles gem installation.
- `.devcontainer/docker-compose.yml`: This defines `app` and `db` services.
  The `app` service builds from the Dockerfile and mounts your project
  code. The `db` service uses a standard PostgreSQL image.
- `.devcontainer/devcontainer.json`: I've updated this to use the Docker Compose
  setup, specifying the `app` service and `/workspace` folder.
  I removed redundant features and updated the `postCreateCommand` to
  ensure dependencies are installed and the database is prepared.

This provides an integrated environment with the Rails application and
a PostgreSQL database service, suitable for GitHub Codespaces and
VS Code Remote - Containers.
@elg0nz elg0nz marked this pull request as draft June 17, 2025 19:51
@compwron
Copy link
Member

I approved CI to run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display a list of email addresses of applicants for easy inviting to things
2 participants