summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-14 18:34:48 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-14 18:34:48 +0200
commit14a02a6a95353948d00f8f973b35b80ac06f4599 (patch)
treed9dbdee6528f1dfeb7a827e95c35e707436e7d49 /app/models/deployment.rb
parent006b65098806fde2a467d9a79347d2978c992e89 (diff)
downloadgitlab-ce-14a02a6a95353948d00f8f973b35b80ac06f4599.tar.gz
Improve design after review
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 32799ee27e6..d9006b70e30 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -6,10 +6,10 @@ class Deployment < ActiveRecord::Base
belongs_to :user
belongs_to :deployable, polymorphic: true
- validates_presence_of :sha
- validates_presence_of :ref
- validates_associated :project
- validates_associated :environment
+ validates :sha, presence: true
+ validates :ref, presence: true
+ validates :project, associated: true
+ validates :environment, associated: true
delegate :name, to: :environment, prefix: true
@@ -22,7 +22,7 @@ class Deployment < ActiveRecord::Base
end
def short_sha
- Commit::truncate_sha(sha)
+ Commit.truncate_sha(sha)
end
def last?