Merge pull request #467 from warpc/429-uname_format_error_explain
[refs #429] Add format explain error message for uname
This commit is contained in:
commit
bb8eab62c9
|
@ -21,7 +21,7 @@ class Project < ActiveRecord::Base
|
|||
has_many :advisories # should be without :dependent => :destroy
|
||||
has_many :packages, :class_name => "BuildList::Package", :dependent => :destroy
|
||||
|
||||
validates :name, :uniqueness => {:scope => [:owner_id, :owner_type], :case_sensitive => false}, :presence => true, :format => {:with => /^#{NAME_REGEXP}$/}
|
||||
validates :name, :uniqueness => {:scope => [:owner_id, :owner_type], :case_sensitive => false}, :presence => true, :format => {:with => /^#{NAME_REGEXP}$/, :message => I18n.t("activerecord.errors.project.uname")}
|
||||
validates :owner, :presence => true
|
||||
validate { errors.add(:base, :can_have_less_or_equal, :count => MAX_OWN_PROJECTS) if owner.projects.size >= MAX_OWN_PROJECTS }
|
||||
|
||||
|
|
|
@ -88,3 +88,6 @@ en:
|
|||
group: Group
|
||||
default_branch: Default branch
|
||||
is_rpm: Project is a packet
|
||||
errors:
|
||||
project:
|
||||
uname: The name can only use lower case Latin letters (a-z), numbers (0-9) and underscore (_)
|
||||
|
|
|
@ -88,3 +88,6 @@ ru:
|
|||
group: Группа
|
||||
default_branch: Ветка по умолчанию
|
||||
is_rpm: Проект является пакетом
|
||||
errors:
|
||||
project:
|
||||
uname: В имени можно использовать только строчные символы латинского алфавита (a-z), цифры (0-9) и символ нижнего подчеркивания (_)
|
||||
|
|
Loading…
Reference in New Issue