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-01-30 18:21:03 -05:00
|
|
|
application.version = application.class.const_get(:VERSION)
|
|
|
|
end
|
2018-07-22 06:48:53 -04:00
|
|
|
end
|
|
|
|
end
|
2019-02-07 16:40:55 -05:00
|
|
|
|
|
|
|
def update_available?
|
|
|
|
version != self.class.const_get(:VERSION)
|
|
|
|
end
|
2018-07-22 06:48:53 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|