advanced pipeline

This commit is contained in:
2026-08-25 23:50:11 +02:00
parent c8dc153e80
commit 3f5caf947f
30 changed files with 44 additions and 42 deletions
-2
View File
@@ -1,5 +1,4 @@
module WarpEngine
class DeviceGrant < ApplicationRecord
self.table_name = "device_grants"
@@ -58,7 +57,6 @@ module WarpEngine
end
def self.generate_user_code
10.times do
candidate = Array.new(USER_CODE_LENGTH) { USER_CODE_ALPHABET.chars.sample }.join
return candidate unless exists?(user_code: candidate)
+1 -1
View File
@@ -16,7 +16,7 @@ module WarpEngine
validate :c64_cannot_be_web_playable
def self.latest_non_dev(releases)
sorted = releases.sort_by { |r| [r.created_at || Time.at(0), r.id] }.reverse
sorted = releases.sort_by { |r| [ r.created_at || Time.at(0), r.id ] }.reverse
candidates = sorted.reject { |r| r.version.to_s.start_with?("dev-") }
candidates.empty? ? sorted.first : candidates.first
end