activerecord-mysql2rgeo-adapter icon indicating copy to clipboard operation
activerecord-mysql2rgeo-adapter copied to clipboard

Rails 7.2 support

Open denisahearn opened this issue 1 year ago • 1 comments

Changes necessary to build the gem and get passing tests with Rails 7.2

Note: The CI build fails with Ruby 2.7. Would the maintainers of https://github.com/stadia/activerecord-mysql2rgeo-adapter be open to the idea of dropping support for Ruby 2.x?

denisahearn avatar Sep 03 '24 19:09 denisahearn

Merged with latest changes in main, fixed merge conflicts

denisahearn avatar Sep 06 '24 18:09 denisahearn

Hello. Will this PR be reviewed?

denisahearn avatar Oct 24 '24 20:10 denisahearn

@stadia are there any updates on if/when this PR might be reviewed? We rely on the activerecord-mysql2rgeo-adapter gem and the lack of Rails 7.2 support is impeding our rails upgrade efforts.

kmfrett avatar Feb 27 '25 21:02 kmfrett

It appears the author, @stadia, used the /gemini command without specifying an argument. This command requires an argument, such as review or summary. If the intention was to initiate a code review, the correct command is /gemini review. If they were looking for a summary of the pull request, it would be /gemini summary. For a list of available commands, they can use /gemini help.

gemini-code-assist[bot] avatar Feb 28 '25 00:02 gemini-code-assist[bot]

/gemini review

stadia avatar Feb 28 '25 00:02 stadia

/gemini summary

stadia avatar Feb 28 '25 00:02 stadia

Summary of Changes

This pull request updates the activerecord-mysql2rgeo-adapter gem to support Rails 7.2. It includes changes to the gemspec, gemfiles, appraisal file, and test configurations to reflect the new Rails version. Additionally, it registers the adapter to prevent a deprecation warning and fixes a test failure related to decimal formatting in JSON output. A with_connection method was added to address test failures related to schema dumping.

Highlights

  • Rails 7.2 Support: The gem is updated to be compatible with Rails 7.2, including updating dependencies and configurations.
  • Adapter Registration: The adapter is now registered to avoid the ActiveRecord::AdapterNotFound error in Rails 7.2.
  • Test Fixes: A test failure related to decimal formatting in JSON output has been resolved, and a with_connection method was added to fix schema dumping issues.

Changelog

Click here to see the changelog
  • .github/workflows/tests.yml
    • Updated the Ruby version to 3.1 in the test matrix.
    • Updated the gemfile to ar72.gemfile.
  • .rubocop_todo.yml
    • Updated the excluded gemfile to ar72.gemfile.
  • .travis.yml
    • Updated the gemfile to ar72.gemfile.
  • Appraisals
    • Updated the appraisal to ar72 and ActiveRecord version to ~> 7.2.0.
  • CONTRIBUTING.md
    • Updated the gemfile references to ar72.gemfile in the example commands.
  • activerecord-mysql2rgeo-adapter.gemspec
    • Updated the ActiveRecord dependency to ~> 7.2.0.
    • Updated the required Ruby version to '>= 2.7.0'
  • gemfiles/ar72.gemfile
    • Updated the ActiveRecord gem version to ~> 7.2.0.
  • lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb
    • Added valid_column_definition_options method to allow geographic, has_m, spatial_type, and srid column definition options.
  • lib/active_record/connection_adapters/mysql2rgeo/version.rb
    • Updated the gem version to 7.2.0.
  • lib/active_record/connection_adapters/mysql2rgeo_adapter.rb
    • Updated the initialize method to use argument forwarding.
    • Added a with_connection method that yields self.
  • lib/activerecord-mysql2rgeo-adapter.rb
    • Registered the adapter using ActiveRecord::ConnectionAdapters.register.
  • test/basic_test.rb
    • Updated the regex in test_point_to_json to account for possible missing decimal places.

Activity

  • The author, denisahearn, merged the PR with the latest changes in main and fixed merge conflicts.
  • denisahearn asked if the PR would be reviewed.
  • kmfrett inquired about the status of the PR, highlighting the need for Rails 7.2 support.
  • gemini-code-assist[bot] pointed out that the /gemini command was used without an argument.
  • stadia requested a code review using /gemini review.
  • stadia requested a summary using /gemini summary.
  • denisahearn provided context for several changes via review comments, linking to relevant Rails PRs and explaining the purpose of the with_connection method and the adapter registration.
  • denisahearn explained the fix for the test_point_to_json failure.

gemini-code-assist[bot] avatar Feb 28 '25 00:02 gemini-code-assist[bot]