cosmetical cleanup of models

This commit is contained in:
Nihad Abbasov 2012-09-26 23:20:36 -07:00
parent 2a4359a572
commit 841e4fbd08
18 changed files with 108 additions and 226 deletions

View file

@ -1,25 +1,10 @@
# == Schema Information
#
# Table name: milestones
#
# id :integer not null, primary key
# title :string(255) not null
# project_id :integer not null
# description :text
# due_date :date
# closed :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
class Milestone < ActiveRecord::Base
attr_accessible :title, :description, :due_date, :closed
belongs_to :project
has_many :issues
validates_presence_of :project_id
validates_presence_of :title
validates_presence_of :title, :project_id
def self.active
where("due_date > ? OR due_date IS NULL", Date.today)
@ -39,3 +24,17 @@ class Milestone < ActiveRecord::Base
"expires at #{due_date.stamp("Aug 21, 2011")}" if due_date
end
end
# == Schema Information
#
# Table name: milestones
#
# id :integer not null, primary key
# title :string(255) not null
# project_id :integer not null
# description :text
# due_date :date
# closed :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#