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