[Rt-commit] rt branch, update-action, updated. 057d86985507db15c0525f5f6fb262d2170ec94e

sartak at bestpractical.com sartak at bestpractical.com
Wed Dec 9 06:30:50 EST 2009


The branch, update-action has been updated
       via  057d86985507db15c0525f5f6fb262d2170ec94e (commit)
      from  7dc46684a51f5866bdb678168f5d4a201b12d061 (commit)

Summary of changes:
 lib/RT/Action/TicketAction.pm |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 057d86985507db15c0525f5f6fb262d2170ec94e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 9 06:30:17 2009 -0500

    Catch setting the record in TicketAction so we can set queue

diff --git a/lib/RT/Action/TicketAction.pm b/lib/RT/Action/TicketAction.pm
index e196da5..c5b12e9 100644
--- a/lib/RT/Action/TicketAction.pm
+++ b/lib/RT/Action/TicketAction.pm
@@ -6,6 +6,21 @@ use base 'RT::Action::QueueBased', 'RT::Action::WithCustomFields';
 use constant record_class => 'RT::Model::Ticket';
 use constant report_detailed_messages => 1;
 
+# We can't use SUPER here because TicketAction does not inherit from
+# Jifty::Action::Record, and SUPER is statically determined. Maybe time to
+# switch to roles.
+sub record {
+    my $self = shift;
+    return $self->Jifty::Action::Record::record if @_ == 0; # reader
+
+    my $record = shift;
+    my $ret = $self->Jifty::Action::Record::record($record, @_);
+
+    $self->set_queue($record->queue);
+
+    return $ret;
+}
+
 sub after_set_queue {
     my $self  = shift;
     my $queue = shift;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list