[Bast-commits] r8670 -
DBIx-Class/0.08/branches/resultset-remove-columns/lib/DBIx/Class
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Sat Feb 13 01:11:31 GMT 2010
Author: frew
Date: 2010-02-13 01:11:31 +0000 (Sat, 13 Feb 2010)
New Revision: 8670
Modified:
DBIx-Class/0.08/branches/resultset-remove-columns/lib/DBIx/Class/ResultSet.pm
Log:
for realz initial working code for rs remove-columns
Modified: DBIx-Class/0.08/branches/resultset-remove-columns/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/resultset-remove-columns/lib/DBIx/Class/ResultSet.pm 2010-02-13 00:24:05 UTC (rev 8669)
+++ DBIx-Class/0.08/branches/resultset-remove-columns/lib/DBIx/Class/ResultSet.pm 2010-02-13 01:11:31 UTC (rev 8670)
@@ -2787,6 +2787,17 @@
@cols = @{ delete $attrs->{columns}}
} elsif ( defined $attrs->{columns} ) {
@cols = delete $attrs->{columns}
+ } elsif ( defined $attrs->{'remove-columns'}) {
+ for ($source->columns) {
+ # cribbed from http://www.stonehenge.com/merlyn/UnixReview/col11.html
+ # Set subtraction
+ my %temp = ();
+ @temp{$source->columns} = ();
+ foreach (@{ $attrs->{'remove-columns'} }) {
+ delete $temp{$_};
+ }
+ @cols = keys %temp;
+ }
} else {
@cols = $source->columns
}
More information about the Bast-commits
mailing list