Skip to content
Snippets Groups Projects
Commit bc4a9fe5 authored by Richie Min's avatar Richie Min
Browse files

validate polling_interval format

parent 2324b3d1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,6 +3,8 @@ class Project < ActiveRecord::Base
 
validates_presence_of :name, :path, :scripts, :timeout, :token, :default_ref
 
validates :polling_interval, :format => { :with => /^[1-9]\d{0,7}[s|m|d]$/ }, :unless => Proc.new{|project| project.polling_interval.blank?}
has_many :builds, dependent: :destroy
 
validate :repo_present?
Loading
Loading
Loading
Loading
@@ -18,10 +18,10 @@
= f.label :token, "Token (Leave empty to generate random token)"
= f.text_field :token, class: 'input-xlarge', placeholder: 'xEeFCaDAB89'
.field
= f.label :always_build, "always_build"
= f.label :always_build, "Always_build"
= f.check_box :always_build
.field
= f.label :polling_interval, "polling_interval"
= f.label :polling_interval, "Polling_interval"
= f.text_field :polling_interval
 
%fieldset
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment