Project

General

Profile

Revision 720671b8

Added by Ondřej Pražák over 6 years ago

Fixes #13288 - Fix for pattrenfly UI

View differences:

app/models/foreman_pipeline/jenkins_instance.rb
14 14
    has_many :jobs, :class_name => "ForemanPipeline::Job", :dependent => :nullify
15 15
    belongs_to :jenkins_user, :class_name => "ForemanPipeline::JenkinsUser"
16 16

  
17
    FILEPATH_REGEX = /^(\/|~)[a-z0-9\-_.\/]*[^\/]$/i
17
    FILEPATH_REGEX = /\A(\/|~)[a-z0-9\-_.\/]*[^\/]\z/i
18 18

  
19 19
    validates :name, :presence => true
20 20
    validates :cert_path, :format => {:with => FILEPATH_REGEX }
21
    validates :url, :uniqueness => true, :format => { :with => /^(http|https):\/\/\S+:\d{1,4}$/}
21
    validates :url, :uniqueness => true, :format => { :with => /\A(http|https):\/\/\S+:\d{1,4}\z/}
22 22
    validates :organization, :presence => true
23 23
    validates :jenkins_home, :format => { :with => FILEPATH_REGEX }
24 24

  

Also available in: Unified diff