Merge branch 'master' of github.com:evilmartians/rosa-build

This commit is contained in:
Alexey Nayden 2011-03-10 13:50:05 +03:00
commit f99233061e
2 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@ -3,5 +3,6 @@ db/*.sqlite3
log/*.log
tmp/
config/database.yml
.idea
config/application.yml
public/stylesheets/compiled/style.css

View File

@ -1,12 +1,13 @@
class Platform < ActiveRecord::Base
validate :name, :presence => true, :uniqueness => true
validate :unixname, :presence => true, :uniqueness => true
before_validation :generate_unixname
validate :validate_unixname
has_many :projects, :dependent => :destroy
has_one :parent, :class_name => 'Platform', :foreign_key => 'parent_platform_id'
validate :name, :presence => true, :uniqueness => true
validate :unixname, :presence => true, :uniqueness => true
validate :validate_unixname
before_validation :generate_unixname
protected
def generate_unixname