Added revision number to config

This commit is contained in:
2020-06-18 15:26:25 -05:00
parent fd160c13c5
commit 2a0e3f7e18
2 changed files with 7 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ module TAC
def config_changed! def config_changed!
@config.configuration.updated_at = Time.now @config.configuration.updated_at = Time.now
@config.configuration.revision += 1
@config_changed = true @config_changed = true
end end

View File

@@ -41,10 +41,11 @@ module TAC
end end
class Configuration class Configuration
attr_accessor :created_at, :updated_at, :spec_version attr_accessor :created_at, :updated_at, :spec_version, :revision
def initialize(created_at:, updated_at:, spec_version:) def initialize(created_at:, updated_at:, spec_version:, revision:)
@created_at, @updated_at = created_at, updated_at @created_at, @updated_at = created_at, updated_at
@spec_version = spec_version @spec_version = spec_version
@revision = revision
end end
def to_json(*args) def to_json(*args)
@@ -52,6 +53,7 @@ module TAC
created_at: @created_at, created_at: @created_at,
updated_at: @updated_at, updated_at: @updated_at,
spec_version: @spec_version, spec_version: @spec_version,
revision: @revision,
}.to_json(*args) }.to_json(*args)
end end
@@ -59,7 +61,8 @@ module TAC
Configuration.new( Configuration.new(
created_at: hash[:created_at], created_at: hash[:created_at],
updated_at: hash[:updated_at], updated_at: hash[:updated_at],
spec_version: hash[:spec_version] spec_version: hash[:spec_version],
revision: hash[:revision],
) )
end end
end end