diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-20 09:55:00 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-20 09:55:00 +0000 |
commit | 7f5d984d5da51766712a86f218110c7d1214048c (patch) | |
tree | 35450dbfd05a7308901848180891811c3fc9f1c7 | |
parent | dc835fccba76ef5197505acbb8c157637ae2874b (diff) | |
parent | 2823d2707e9e1a1d728fc7ae3da16edf6b1ba4e7 (diff) | |
download | gitlab-ce-7f5d984d5da51766712a86f218110c7d1214048c.tar.gz |
Merge branch 'remove-unnecessary-validate-project' into 'master'
Remove unecessary validate: true from belongs_to :project
See merge request gitlab-org/gitlab-ce!17166
-rw-r--r-- | app/models/deployment.rb | 4 | ||||
-rw-r--r-- | app/models/environment.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/remove-unnecessary-validate-project.yml | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 3aed071dd49..b6cf168d60e 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -1,8 +1,8 @@ class Deployment < ActiveRecord::Base include InternalId - belongs_to :project, required: true, validate: true - belongs_to :environment, required: true, validate: true + belongs_to :project, required: true + belongs_to :environment, required: true belongs_to :user belongs_to :deployable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations diff --git a/app/models/environment.rb b/app/models/environment.rb index 2f6eae605ee..f78c21aebe5 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -4,7 +4,7 @@ class Environment < ActiveRecord::Base NUMBERS = '0'..'9' SUFFIX_CHARS = LETTERS.to_a + NUMBERS.to_a - belongs_to :project, required: true, validate: true + belongs_to :project, required: true has_many :deployments, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent diff --git a/changelogs/unreleased/remove-unnecessary-validate-project.yml b/changelogs/unreleased/remove-unnecessary-validate-project.yml new file mode 100644 index 00000000000..ebc8da03dd8 --- /dev/null +++ b/changelogs/unreleased/remove-unnecessary-validate-project.yml @@ -0,0 +1,5 @@ +--- +title: 'Remove unecessary validate: true from belongs_to :project' +merge_request: +author: +type: fixed |