[#4181] Require a Deliverable's title, type, and manager.
This commit is contained in:
1 parent
2ce9c55239
commit
19958fe16e
3 files changed
+20
-2
No files matched your search
@@ -6,10 +6,24 @@ class Deliverable < ActiveRecord::Base
|
||||
belongs_to :manager, :class_name => 'User', :foreign_key => 'manager_id'
|
||||
|
||||
# Validations
|
||||
|
||||
validates_presence_of :title
|
||||
validates_presence_of :type
|
||||
validates_presence_of :manager
|
||||
|
||||
# Accessors
|
||||
|
||||
def short_type
|
||||
''
|
||||
end
|
||||
|
||||
if Rails.env.test?
|
||||
generator_for :title, :method => :next_title
|
||||
|
||||
def self.next_title
|
||||
@last_title ||= 'Deliverable 0000'
|
||||
@last_title.succ!
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user