[Bps-public-commit] r19690 - Net-Google-Code/trunk/lib/Net/Google/Code/Issue

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri May 15 08:38:05 EDT 2009


Author: sunnavy
Date: Fri May 15 08:38:05 2009
New Revision: 19690

Modified:
   Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Search.pm

Log:
add load_after_search attr so we can control if we want to fully load a ticket or not

Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Search.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Search.pm	(original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Search.pm	Fri May 15 08:38:05 2009
@@ -49,6 +49,12 @@
     is  => 'rw',
 );
 
+has 'load_after_search' => (
+    isa     => 'Bool',
+    is      => 'rw',
+    default => 1,
+);
+
 sub search {
     my $self = shift;
     if ( scalar @_ ) {
@@ -56,6 +62,8 @@
         $self->_can( $args{_can} ) if defined $args{_can};
         $self->_q( $args{_q} )     if defined $args{_q};
         $self->limit( $args{limit} ) if defined $args{limit};
+        $self->load_after_search( $args{load_after_search} )
+          if defined $args{load_after_search};
     }
 
     $self->fetch( $self->base_url . 'issues/list' );
@@ -76,6 +84,7 @@
         # get only one ticket
         my $issue =
           Net::Google::Code::Issue->new( project => $self->project, id => $1, );
+        $issue->load if $self->load_after_search;
         $self->results( [ $issue ] );
     }
     elsif ( $mech->title =~ /Issues/ ) {
@@ -88,6 +97,7 @@
                 project => $self->project,
                 id      => $id,
             );
+            $issue->load if $self->load_after_search;
             push @issues, $issue;
         }
         $self->results( \@issues );



More information about the Bps-public-commit mailing list