summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-05-22 15:47:58 +0900
committerShinya Maeda <shinya@gitlab.com>2018-05-22 15:47:58 +0900
commit1714bff71d2e352133f09a50c83685d011b3e56f (patch)
tree38d06e77f69d311a4684c0f4089e93a2570fa238
parentad4834e5f96ebc96036e651e139514d692a3409b (diff)
downloadgitlab-ce-add-ar-validation-for-file-store-columns.tar.gz
Remove conditions of validationadd-ar-validation-for-file-store-columns
-rw-r--r--app/models/ci/job_artifact.rb2
-rw-r--r--app/models/lfs_object.rb2
-rw-r--r--app/models/upload.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb
index 64665f34cf1..3ba6707b87e 100644
--- a/app/models/ci/job_artifact.rb
+++ b/app/models/ci/job_artifact.rb
@@ -17,7 +17,7 @@ module Ci
scope :with_files_stored_locally, -> { where(file_store: [nil, ::JobArtifactUploader::Store::LOCAL]) }
- validates :file_store, presence: true, if: :file_changed?
+ validates :file_store, presence: true
delegate :exists?, :open, to: :file
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb
index 66abdba5028..e5b02a0aa3c 100644
--- a/app/models/lfs_object.rb
+++ b/app/models/lfs_object.rb
@@ -8,7 +8,7 @@ class LfsObject < ActiveRecord::Base
scope :with_files_stored_locally, -> { where(file_store: [nil, LfsObjectUploader::Store::LOCAL]) }
validates :oid, presence: true, uniqueness: true
- validates :file_store, presence: true, if: :file_changed?
+ validates :file_store, presence: true
mount_uploader :file, LfsObjectUploader
diff --git a/app/models/upload.rb b/app/models/upload.rb
index 1a2cc3fec02..f7118d4dfbf 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -8,7 +8,7 @@ class Upload < ActiveRecord::Base
validates :path, presence: true
validates :model, presence: true
validates :uploader, presence: true
- validates :store, presence: true, if: :mount_point_changed?
+ validates :store, presence: true
scope :with_files_stored_locally, -> { where(store: [nil, ObjectStorage::Store::LOCAL]) }