Revision f34463c4
Added by Paul Kelly almost 14 years ago
- ID f34463c46a5e1f132e9c5d1cc396e866ada0cec4
app/models/environment.rb | ||
---|---|---|
has_many :hosts
|
||
validates_presence_of :name
|
||
validates_uniqueness_of :name
|
||
validates_format_of :name, :with => /^\S+$/, :message => "cannot contain spaces"
|
||
validates_format_of :name, :with => /^[\w\d]+$/, :message => "is alphanumeric and cannot contain spaces"
|
||
default_scope :order => 'name'
|
||
|
||
def to_label
|
Also available in: Unified diff
Fixes #256 - Environment names should be alphanumeric