From 1c5e0c47c92128afebef5614407d84cd72c12b35 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 28 Nov 2012 16:40:21 +0800 Subject: Bug 814411: Add a caching mechanism to Bugzilla::Object to avoid querying the database repeatedly for the same information --- Bugzilla/Comment.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Comment.pm') diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index ee342fb2d..643767232 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -143,7 +143,8 @@ sub is_about_attachment { sub attachment { my ($self) = @_; return undef if not $self->is_about_attachment; - $self->{attachment} ||= new Bugzilla::Attachment($self->extra_data); + $self->{attachment} ||= + new Bugzilla::Attachment({ id => $self->extra_data, cache => 1 }); return $self->{attachment}; } -- cgit v1.2.3-24-g4f1b