FIX: Correct version comparison logic when comparing stable to beta (PR #10135)

For example, version 1.3.0 should be considered higher than 1.3.0.beta3. So Discourse.has_needed_version?('1.3.0', '1.3.0.beta3') should return true


This pull request has been mentioned on Discourse Meta. There might be relevant details there:

Can we replace all this custom logic with just Gem::Version?'1.3.0') >'1.3.0.beta3')
=> true

:joy: well yes, I guess we can! I assumed that we had a custom implementation because our .beta# syntax was a little weird.But it looks like Gem::Version works just fine.

Updated the PR

do we need to backport this?