2006-02-09 09:17:40 +00:00
|
|
|
class Company < ActiveRecord::Base
|
2008-04-30 19:59:24 +00:00
|
|
|
has_one :mascot
|
2006-02-09 09:17:40 +00:00
|
|
|
attr_protected :rating
|
2011-11-29 16:33:50 +00:00
|
|
|
self.sequence_name = :companies_nonstd_seq
|
2006-02-09 09:17:40 +00:00
|
|
|
|
|
|
|
validates_presence_of :name
|
|
|
|
def validate
|
|
|
|
errors.add('rating', 'rating should not be 2') if rating == 2
|
2010-08-14 05:13:00 +00:00
|
|
|
end
|
2011-11-29 16:33:50 +00:00
|
|
|
end
|