From 4ee55dc45690654dbbb6827cb687445aa405e839 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 2 Jan 2007 10:12:15 +0000 Subject: [PATCH] updated validation format of repository url to allow file:/// git-svn-id: http://redmine.rubyforge.org/svn/trunk@137 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository.rb | 2 +- app/views/projects/_form.rhtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 28f2c5a163..29e87584fa 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -18,7 +18,7 @@ class Repository < ActiveRecord::Base belongs_to :project validates_presence_of :url - validates_format_of :url, :with => /^(http|https|svn):\/\/.+/i + validates_format_of :url, :with => /^(http|https|svn|file):\/\/.+/i @scm = nil diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml index a6102e0126..8c5b9f108d 100644 --- a/app/views/projects/_form.rhtml +++ b/app/views/projects/_form.rhtml @@ -30,7 +30,7 @@ <%= hidden_field_tag "repository_enabled", 0 %>
<% fields_for :repository, @project.repository, { :builder => TabularFormBuilder, :lang => current_language} do |repository| %> -

<%= repository.text_field :url, :size => 60, :required => true %>
(http://, https://, svn://)

+

<%= repository.text_field :url, :size => 60, :required => true %>
(http://, https://, svn://, file:///)

<% end %>
<%= javascript_tag "Element.hide('repository');" if @project.repository.nil? %>