Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-09-27 10:20:36 +0400
committerNihad Abbasov <narkoz.2008@gmail.com>2012-09-27 13:05:53 +0400
commit841e4fbd08d2d642c127506001a76a973ea3d536 (patch)
tree56a894ecdf3978bc3032daa8fae294dad897018d /app/models/milestone.rb
parent2a4359a572c123d117988487f9bb29f4ae176ceb (diff)
cosmetical cleanup of models
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb31
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
+#