Sha256: b807836bbc49c569ca309155beb7985260d4a6b0fafe4a5463f4e9f8bfbd16d0

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

#    This file is part of Branston.
#
#    Branston is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published by
#    the Free Software Foundation.
#
#    Branston is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with Branston.  If not, see <http://www.gnu.org/licenses/>.



class Iteration < ActiveRecord::Base

  # Validations
  #
  validates_presence_of :name, :velocity
  validates_numericality_of :velocity

  # Associations
  #
  has_many :stories
  has_many :participations
  has_many :geeks, :through => :participations, :class_name => "User"
  belongs_to :release

  def burndown_data
    Story.find_by_sql [
      "SELECT SUM(points) AS points,
        completed_date
      FROM stories
      WHERE iteration_id = ?
      AND status = 'completed'
      OR status = 'quality_assurance'
      GROUP BY completed_date
      ORDER BY completed_date", id
    ]
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
branston-0.6.6 lib/branston/app/models/iteration.rb
branston-0.6.5 lib/branston/app/models/iteration.rb
branston-0.6.4 lib/branston/app/models/iteration.rb
branston-0.6.3 lib/branston/app/models/iteration.rb
branston-0.6.2 lib/branston/app/models/iteration.rb