From cca6958b30c67b9573c89eb5cb9dd007e4f7746a Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Fri, 25 Jul 2014 11:54:07 +0100 Subject: [PATCH 1/2] Slight change to prefetch documentation Added some calrification to the documentation on the prefetch attribute. It was unclear to me at first glance how it was different from join. The additional information explicityly explains without the expectation of knowing about all the other functions. --- lib/DBIx/Class/ResultSet.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index b703c8fc6..e0bf58fc3 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -4360,8 +4360,10 @@ For a more in-depth discussion, see L. =back -This attribute is a shorthand for specifying a L spec, adding all -columns from the joined related sources as L and setting +While the L attribute will join a table without including the tables +columns in the select, prefetch will add the columns to the select spec at +the same time. This attribute is a shorthand for specifying a L spec, +adding all columns from the joined related sources as L and setting L to a true value. For example, the following two queries are equivalent: From 1ff34845fe485f92ed21bec1b5ffe2685e1ea2f8 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Thu, 7 Aug 2014 11:17:42 +0100 Subject: [PATCH 2/2] Update ResultSet.pm Updated suggested doc change using @ribasushi s suggestion --- lib/DBIx/Class/ResultSet.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index e0bf58fc3..c16ee8475 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -4360,11 +4360,12 @@ For a more in-depth discussion, see L. =back -While the L attribute will join a table without including the tables -columns in the select, prefetch will add the columns to the select spec at -the same time. This attribute is a shorthand for specifying a L spec, -adding all columns from the joined related sources as L and setting -L to a true value. For example, the following two queries are +This attribute is a shorthand for specifying a L spec, adding all +columns from the joined related sources as L and setting +L to a true value. It can be thought of as a rough B +of the L attribute. + +For example, the following two queries are equivalent: my $rs = $schema->resultset('Artist')->search({}, {