diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-13 21:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-13 21:10:36 +0300 |
commit | c787c1559e9e558b83e78354823eb54b9fe8c718 (patch) | |
tree | 7e358b80fa7acb74db275ff6043f55f52a87738d /app/models/terraform | |
parent | 6df7943512ca90323c69b926404cc561b6305ce2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/terraform')
-rw-r--r-- | app/models/terraform/state.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/app/models/terraform/state.rb b/app/models/terraform/state.rb index 759b9ce1eec..c50b9da1310 100644 --- a/app/models/terraform/state.rb +++ b/app/models/terraform/state.rb @@ -3,6 +3,7 @@ module Terraform class State < ApplicationRecord include UsageStatistics + include FileStoreMounter DEFAULT = '{"version":1}'.freeze HEX_REGEXP = %r{\A\h+\z}.freeze @@ -17,18 +18,10 @@ module Terraform default_value_for(:uuid, allows_nil: false) { SecureRandom.hex(UUID_LENGTH / 2) } - after_save :update_file_store, if: :saved_change_to_file? - - mount_uploader :file, StateUploader + mount_file_store_uploader StateUploader default_value_for(:file) { CarrierWaveStringFile.new(DEFAULT) } - def update_file_store - # The file.object_store is set during `uploader.store!` - # which happens after object is inserted/updated - self.update_column(:file_store, file.object_store) - end - def file_store super || StateUploader.default_store end |