summaryrefslogtreecommitdiff
path: root/app/models/generic_commit_status.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-18 12:02:44 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-18 12:07:19 +0100
commit53f4f849956e10ccbbf4a9011b46b84da33129b0 (patch)
treeba1e9d8d52e64b26b07b5c7eba80f94f5e79b1a9 /app/models/generic_commit_status.rb
parent2e088c06d1ebb5f33469da0eb07664cd170207cc (diff)
downloadgitlab-ce-53f4f849956e10ccbbf4a9011b46b84da33129b0.tar.gz
Add URL validations for generic commit statuses
Diffstat (limited to 'app/models/generic_commit_status.rb')
-rw-r--r--app/models/generic_commit_status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/generic_commit_status.rb b/app/models/generic_commit_status.rb
index 9f6ca11c0df..8867ba0d2ff 100644
--- a/app/models/generic_commit_status.rb
+++ b/app/models/generic_commit_status.rb
@@ -1,6 +1,10 @@
class GenericCommitStatus < CommitStatus
before_validation :set_default_values
+ validates :target_url, addressable_url: true,
+ length: { maximum: 255 },
+ allow_nil: true
+
# GitHub compatible API
alias_attribute :context, :name