use the journal formatters API to register the issue journal formats

This commit is contained in:
Tim Felgentreff 2010-07-29 11:30:24 +02:00
parent 4851451017
commit d34abea14e
1 changed files with 7 additions and 1 deletions

View File

@ -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