summaryrefslogtreecommitdiff
path: root/app/models/protected_branch.rb
diff options
context:
space:
mode:
authorAndrey Kumanyaev <me@zzet.org>2012-10-09 04:10:04 +0400
committerAndrey Kumanyaev <me@zzet.org>2012-10-09 04:10:04 +0400
commitdf7c52489a890ac38491682b4a3399beb7cdbc86 (patch)
tree9a81bee70285ac1e5a0c158eab5f4c981e49b86d /app/models/protected_branch.rb
parenta635b9da97b0e104b8ac1a846344ec8a4abd3123 (diff)
downloadgitlab-ce-df7c52489a890ac38491682b4a3399beb7cdbc86.tar.gz
simple refactoring
Diffstat (limited to 'app/models/protected_branch.rb')
-rw-r--r--app/models/protected_branch.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index c9e88d6bff6..cd93dc1bfe6 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -4,7 +4,8 @@ class ProtectedBranch < ActiveRecord::Base
attr_accessible :name
belongs_to :project
- validates_presence_of :name, :project_id
+ validates :name, presence: true
+ validates :project, presence: true
after_save :update_repository
after_destroy :update_repository