From d34abea14e39f49bead8c7d7a72f23c85f4e1532 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Thu, 29 Jul 2010 11:30:24 +0200 Subject: [PATCH] use the journal formatters API to register the issue journal formats --- app/models/issue.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 76010358..72443107 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -36,9 +36,15 @@ class Issue < ActiveRecord::Base acts_as_customizable acts_as_watchable - acts_as_journalized :event_title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"}, + acts_as_journalized :event_title => Proc.new {|o| "#{o.tracker.name} ##{o.versioned.id} (#{o.status}): #{o.subject}"}, :event_type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') } + register_on_journal_formatter(:id, 'parent_id') + register_on_journal_formatter(:named_association, 'project_id', 'status_id', 'tracker_id', 'assigned_to_id', + 'priority_id', 'category_id', 'fixed_version_id') + register_on_journal_formatter(:fraction, 'estimated_hours', 'done_ratio') + register_on_journal_formatter(:datetime, 'due_date', 'start_date') + acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"], :include => [:project, :journals], # sort by id so that limited eager loading doesn't break with postgresql