Closed blaet closed 5 months ago
Ensure Rails versions are properly checked, instead of relying on String comparisons.
String
Example of why this is an issue
[8] pry(main)> Rails.version > "10.2.3" => true [9] pry(main)> Gem::Version.new(Rails.version) >= Gem::Version.new("10.2.3") => false
This example was taken from this comment on a recent PR.
This change leverages the already existing function Rails.gem_version. This has been part of the Rails codebase for 10+ years, making it compatible with all supported Rails versions.
Rails.gem_version
Fixed a small syntax error. Build should now be 🍏
Hi @danielmorrison, any chance you could have a look at this one? Thanks so much! 🚀
Ensure Rails versions are properly checked, instead of relying on
String
comparisons.Example of why this is an issue
This example was taken from this comment on a recent PR.
Approach
This change leverages the already existing function
Rails.gem_version
. This has been part of the Rails codebase for 10+ years, making it compatible with all supported Rails versions.