Merge remote-tracking branch 'parent/main' into upstream-20241119
This commit is contained in:
commit
055045981f
221 changed files with 2006 additions and 1127 deletions
|
@ -22,6 +22,14 @@ class SoftwareUpdate < ApplicationRecord
|
|||
Gem::Version.new(version)
|
||||
end
|
||||
|
||||
def outdated?
|
||||
runtime_version >= gem_version
|
||||
end
|
||||
|
||||
def pending?
|
||||
gem_version > runtime_version
|
||||
end
|
||||
|
||||
class << self
|
||||
def check_enabled?
|
||||
Rails.configuration.x.mastodon.software_update_url.present?
|
||||
|
@ -30,7 +38,7 @@ class SoftwareUpdate < ApplicationRecord
|
|||
def pending_to_a
|
||||
return [] unless check_enabled?
|
||||
|
||||
all.to_a.filter { |update| update.gem_version > Mastodon::Version.gem_version }
|
||||
all.to_a.filter(&:pending?)
|
||||
end
|
||||
|
||||
def urgent_pending?
|
||||
|
@ -45,4 +53,10 @@ class SoftwareUpdate < ApplicationRecord
|
|||
pending_to_a.any?(&:patch_type?)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def runtime_version
|
||||
Mastodon::Version.gem_version
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue