2018-07-22 10:48:53 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Clusters
|
|
|
|
module Concerns
|
|
|
|
module ApplicationVersion
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
state_machine :status do
|
2019-01-30 23:59:26 +00:00
|
|
|
before_transition any => [:installed, :updated] do |application|
|
2019-10-16 03:06:12 +00:00
|
|
|
application.version = application.class.const_get(:VERSION, false)
|
2019-01-30 23:21:03 +00:00
|
|
|
end
|
2018-07-22 10:48:53 +00:00
|
|
|
end
|
|
|
|
end
|
2019-02-07 21:40:55 +00:00
|
|
|
|
|
|
|
def update_available?
|
2019-10-16 03:06:12 +00:00
|
|
|
version != self.class.const_get(:VERSION, false)
|
2019-02-07 21:40:55 +00:00
|
|
|
end
|
2018-07-22 10:48:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|