##// END OF EJS Templates
Added observers to watch model objects for mail delivery instead of calling Mailer....
Added observers to watch model objects for mail delivery instead of calling Mailer. * Added an IssueObserver to watch when Issues are created * Added a JournalObserver to watch when Journals are created (Issue updates) * Added a NewsObserver for News items. * Added a DocumentObserver for Document notifications. * Setup IssuesController#new to use the IssueObserver. * Setup IssuesController#edit to use the IssueObserver. * Setup IssuesController#bulk_edit to use the JournalObserver. * Removed the Mailer call in Changeset#scan_commit_for_issue_ids, the JournalObserver will handle it. * Removed Mailer calls in MailHandler in favor of the Observers. #2659 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2637 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2363:c68721911370
r2548:b4be8849c0de
Show More
tracker.rb
56 lines | 2.2 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
# 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.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Tracker < ActiveRecord::Base
before_destroy :check_integrity
has_many :issues
Jean-Philippe Lang
Workflow copy:...
r1237 has_many :workflows, :dependent => :delete_all do
def copy(tracker)
raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
clear
Jean-Philippe Lang
Removes hardcoded table names (#2701)....
r2363 connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
Jean-Philippe Lang
Workflow copy:...
r1237 " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
Jean-Philippe Lang
Removes hardcoded table names (#2701)....
r2363 " FROM #{Workflow.table_name}" +
Jean-Philippe Lang
Workflow copy:...
r1237 " WHERE tracker_id = #{tracker.id}"
end
end
Jean-Philippe Lang
On the calendar, the gantt and in the Tracker filter on the issue list, only active trackers of the project (and its sub projects) can be selected....
r1057 has_and_belongs_to_many :projects
Jean-Philippe Lang
fixed #9308 table_name pre/suffix support...
r334 has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 acts_as_list
validates_presence_of :name
validates_uniqueness_of :name
Jean-Philippe Lang
Added several validates_length_of...
r590 validates_length_of :name, :maximum => 30
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 validates_format_of :name, :with => /^[\w\s\'\-]*$/i
Jean-Philippe Lang
Added the ability to customize columns of a saved query....
r771 def to_s; name end
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 def <=>(tracker)
name <=> tracker.name
end
Jean-Philippe Lang
Added per-project tracker selection. Trackers can be selected on project settings....
r907 def self.all
find(:all, :order => 'position')
end
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 private
def check_integrity
raise "Can't delete tracker" if Issue.find(:first, :conditions => ["tracker_id=?", self.id])
Jean-Philippe Lang
Initial commit...
r2 end
end