Skip to content
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

Fix Rails version comparison #1614

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

santib
Copy link
Contributor

@santib santib commented Nov 8, 2023

the previous condition would return false for Rails 8.0, when what we actually want is to always return true for versions > 7.1, right?

MaicolBen
MaicolBen previously approved these changes Nov 10, 2023
Copy link
Collaborator

@MaicolBen MaicolBen left a comment

Choose a reason for hiding this comment

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

Right! Thank you santi !!

@MaicolBen MaicolBen dismissed their stale review November 10, 2023 16:38

It fails so we need to support older versions of ruby

@@ -2,7 +2,7 @@ module DeviseTokenAuth::Concerns::ActiveRecordSupport
extend ActiveSupport::Concern

included do
if Rails::VERSION::MAJOR >= 7 && Rails::VERSION::MINOR >= 1
if Gem::Version.new(Rails::VERSION::STRING) >= "7.1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This fails in ruby < 3.1 with ArgumentError: comparison of Gem::Version with String failed . Maybe try with Rails.gem_version >= Gem::Version.new("7.1.x") ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. There I pushed your suggestion with a minor change to account for pre-release versions

image

@MaicolBen MaicolBen merged commit 6b0659f into lynndylanhurley:master Nov 13, 2023
51 checks passed
@scott-knight
Copy link

@MaicolBen hate to bug you about this, but this merge needs to be tagged for a RubyGems release. The graphql_devise update for Rails 7.1 is on hold until there is an updated release from devise_token_auth. Thanks in advance.

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.

3 participants