summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 12:03:49 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 12:03:49 +0200
commit2541e50d7ce64bb402d06dc9d75567b78282c7b7 (patch)
treeab2fc7f250cc10631da0ffb9b5bd6f2d50ca4974 /app/models/deployment.rb
parent14a02a6a95353948d00f8f973b35b80ac06f4599 (diff)
downloadgitlab-ce-2541e50d7ce64bb402d06dc9d75567b78282c7b7.tar.gz
Improve validations
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index d9006b70e30..cda922080cb 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -1,15 +1,13 @@
class Deployment < ActiveRecord::Base
include InternalId
- belongs_to :project
- belongs_to :environment
+ belongs_to :project, required: true
+ belongs_to :environment, required: true
belongs_to :user
belongs_to :deployable, polymorphic: true
validates :sha, presence: true
validates :ref, presence: true
- validates :project, associated: true
- validates :environment, associated: true
delegate :name, to: :environment, prefix: true