Skip to content

Conversation

@parsahonarmand99
Copy link
Contributor

@parsahonarmand99 parsahonarmand99 commented Jul 18, 2025

Add Rails 8 Compatibility

What does this do?

Rails 8.0 support, allowing host applications using Rails 8 to use this gem without version conflicts.

How does it solve it?

  • Updated ActiveRecord dependency: Changed from "< 8" to "< 9.0" in gemspec
  • Added Rails 8 testing: Created Gemfile.rails-8.0-stable and updated CI matrix
  • Version bump: Updated to 3.4.0
  • Improved Rakefile: Better database setup handling for development
-> % bin/setup
rake aborted!
NoMethodError: undefined method `drop_database' for an instance of ActiveRecord::ConnectionAdapters::SQLite3Adapter (NoMethodError)

    ActiveRecord::Base.connection.drop_database(database_config.fetch(:database))
                                 ^^^^^^^^^^^^^^
Did you mean?  drop_table
/Users/parsahonarmand/clio/polymorphic_integer_type/Rakefile:39:in `block (2 levels) in <top (required)>'
/Users/parsahonarmand/.rbenv/versions/3.3.0/bin/bundle:25:in `load'
/Users/parsahonarmand/.rbenv/versions/3.3.0/bin/bundle:25:in `<main>'
Tasks: TOP => db:drop
(See full trace by running task with --trace)
  • Code modernization: Added frozen string literals and Ruby 3.0+ requirement

Testing?

  • ✅ All 41 tests pass on Rails 8.0 with Ruby 3.2+
  • ✅ Verified compatibility across Rails 6.1, 7.0, 7.2, and 8.0
  • ✅ No breaking changes in Rails 8's ActiveRecord internals affect this gem
  • ✅ CI now tests all supported Rails/Ruby combinations

@parsahonarmand99 parsahonarmand99 requested review from a team as code owners July 18, 2025 21:32
cursor[bot]

This comment was marked as outdated.

Rakefile Outdated
# Handle different Rails versions
active_record_version = Gem::Version.new(ActiveRecord::VERSION::STRING)

if active_record_version >= Gem::Version.new("6.0")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be removing Rails 6.0 support?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, since it's not officially supported anymore and most of our app has moved on.

wendy-clio
wendy-clio previously approved these changes Jul 21, 2025
Copy link
Contributor

@wendy-clio wendy-clio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be great to take the chance to remove the 6.x version support. The upgrade itself LG!

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Ruby 3.0 Excluded Despite Rails Compatibility

The CI matrix includes Ruby 3.0 but then excludes it from all Rails versions (7.0, 7.2, 8.0), leading to zero test jobs for Ruby 3.0. This is incorrect because Rails 7.0 officially supports Ruby 3.0, and the blanket exclusion contradicts the gemspec's required_ruby_version = '>= 3.0'.

.github/workflows/ci.yml#L19-L32

- Gemfile.rails-8.0-stable
ruby-version: ['3.0', '3.1', '3.2', '3.3']
exclude:
# Rails 7.0 doesn't work with Ruby 3.0
- gemfile: Gemfile.rails-7.0-stable
ruby-version: '3.0'
# Rails 7.2 doesn't work with Ruby 3.0
- gemfile: Gemfile.rails-7.2-stable
ruby-version: '3.0'
# Rails 8.0 doesn't work with Ruby 3.0 or 3.1
- gemfile: Gemfile.rails-8.0-stable
ruby-version: '3.0'
- gemfile: Gemfile.rails-8.0-stable
ruby-version: '3.1'

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@parsahonarmand99
Copy link
Contributor Author

@wendy-clio @anthonyoconnorclio Removed rails 6.x support!

Copy link
Contributor

@peerkleio peerkleio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@jeffadavidson jeffadavidson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a look, mostly for CI changes as this is one of our few public repos so I wanted to make sure we didn't introduce any triggers like pull_request_target that can add security risks.

LGTM

@parsahonarmand99 parsahonarmand99 merged commit ced3ea0 into clio:master Jul 25, 2025
9 checks passed
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.

6 participants