Revision 0c0f5ed3
Added by Ohad Levy almost 14 years ago
- ID 0c0f5ed321f338d62039534f3d07143b4ab5a035
app/models/operatingsystem.rb | ||
---|---|---|
validates_presence_of :major, :message => "Operating System version is required"
|
||
validates_presence_of :name
|
||
validates_numericality_of :major
|
||
validates_numericality_of :minor, :allow_nil => true
|
||
validates_numericality_of :minor, :allow_nil => true, :allow_blank => true
|
||
validates_format_of :name, :with => /\A(\S+)\Z/, :message => "can't be blank or contain white spaces."
|
||
before_validation :downcase_release_name
|
||
#TODO: add validation for name and major uniqueness
|
Also available in: Unified diff
fixes #278 - operatingsystem minor field is mandatory