From eea7af43ff2d5fa294200cbb75696985334b8e1f Mon Sep 17 00:00:00 2001 From: "pzupan@gmail.com" Date: Thu, 29 Aug 2019 14:38:35 -0700 Subject: [PATCH] modify sort query --- app/models/extension.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/extension.rb b/app/models/extension.rb index 103caeb0..d0e362b3 100755 --- a/app/models/extension.rb +++ b/app/models/extension.rb @@ -172,7 +172,7 @@ def self.total_download_count def sorted_extension_versions # ignore preceding 'V' and ignore 'master' so it sorts to end # convert version to array of integers so 10.0.0 comes after 9.0.0 - @sorted_extension_versions ||= extension_versions.order(Arel.sql("STRING_TO_ARRAY( REGEXP_REPLACE(extension_versions.version, E'V|v|master', ''), '.')::int[] DESC")) + @sorted_extension_versions ||= extension_versions.order(Arel.sql("STRING_TO_ARRAY( REGEXP_REPLACE(extension_versions.version, E'V|v|master|-(.*)', ''), '.')::int[] DESC")) end #