Class: Tracker

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/tracker.rb

Overview

– copyright ChiliProject is a project management system.

Copyright (C) 2010-2013 the ChiliProject Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

See doc/COPYRIGHT.rdoc for more details. ++

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allObject


42
43
44
# File 'app/models/tracker.rb', line 42

def self.all
  find(:all, :order => 'position')
end

Instance Method Details

#<=>(tracker) ⇒ Object


34
35
36
# File 'app/models/tracker.rb', line 34

def <=>(tracker)
  name <=> tracker.name
end

#issue_statusesObject

Returns an array of IssueStatus that are used in the tracker's workflows


48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'app/models/tracker.rb', line 48

def issue_statuses
  if @issue_statuses
    return @issue_statuses
  elsif new_record?
    return []
  end

  ids = Workflow.
          connection.select_rows("SELECT DISTINCT old_status_id, new_status_id FROM #{Workflow.table_name} WHERE tracker_id = #{id}").
          flatten.
          uniq

  @issue_statuses = IssueStatus.find_all_by_id(ids).sort
end

#to_liquidObject


38
39
40
# File 'app/models/tracker.rb', line 38

def to_liquid
  TrackerDrop.new(self)
end

#to_sObject


32
# File 'app/models/tracker.rb', line 32

def to_s; name end