项目版本库名称限定优化

This commit is contained in:
nwb 2014-07-04 14:19:34 +08:00
parent b42605accd
commit b6ebbab830
2 changed files with 4 additions and 1 deletions

View File

@ -87,8 +87,11 @@ class MessagesController < ApplicationController
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply}) call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attachments = Attachment.attach_files(@reply, params[:attachments]) attachments = Attachment.attach_files(@reply, params[:attachments])
render_attachment_warning_if_needed(@reply) render_attachment_warning_if_needed(@reply)
else
#render file: 'messages#show', layout: 'base_courses'
end end
redirect_to board_message_path(@board, @topic, :r => @reply) redirect_to board_message_path(@board, @topic, :r => @reply)
end end
# Edit a message # Edit a message

View File

@ -42,7 +42,7 @@ class Repository < ActiveRecord::Base
validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
# donwcase letters, digits, dashes, underscores but not digits only # donwcase letters, digits, dashes, underscores but not digits only
validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :allow_blank => true validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]+$/, :allow_blank => true
# Checks if the SCM is enabled when creating a repository # Checks if the SCM is enabled when creating a repository
validate :repo_create_validation, :on => :create validate :repo_create_validation, :on => :create