diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-09-26 23:20:36 -0700 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-09-27 02:05:53 -0700 |
commit | 841e4fbd08d2d642c127506001a76a973ea3d536 (patch) | |
tree | 56a894ecdf3978bc3032daa8fae294dad897018d /app/models/milestone.rb | |
parent | 2a4359a572c123d117988487f9bb29f4ae176ceb (diff) | |
download | gitlab-ce-841e4fbd08d2d642c127506001a76a973ea3d536.tar.gz |
cosmetical cleanup of models
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 9014647c126..da54ac402df 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -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 +# |