Class: Terraform::State

Inherits:
ApplicationRecord show all
Includes:
FileStoreMounter, UsageStatistics
Defined in:
app/models/terraform/state.rb

Constant Summary collapse

DEFAULT =
'{"version":1}'.freeze
HEX_REGEXP =
%r{\A\h+\z}.freeze
UUID_LENGTH =
32

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#file_storeObject


25
26
27
# File 'app/models/terraform/state.rb', line 25

def file_store
  super || StateUploader.default_store
end

#local?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'app/models/terraform/state.rb', line 29

def local?
  file_store == ObjectStorage::Store::LOCAL
end

#locked?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'app/models/terraform/state.rb', line 33

def locked?
  self.lock_xid.present?
end