[Bast-commits] r9135 - in DBIx-Class/0.08/branches/filter_column:
lib/DBIx/Class t/row
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Tue Apr 13 16:09:57 GMT 2010
Author: frew
Date: 2010-04-13 17:09:57 +0100 (Tue, 13 Apr 2010)
New Revision: 9135
Added:
DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t
Modified:
DBIx-Class/0.08/branches/filter_column/lib/DBIx/Class/FilterColumn.pm
Log:
change names wrap accessors
Modified: DBIx-Class/0.08/branches/filter_column/lib/DBIx/Class/FilterColumn.pm
===================================================================
--- DBIx-Class/0.08/branches/filter_column/lib/DBIx/Class/FilterColumn.pm 2010-04-13 14:54:24 UTC (rev 9134)
+++ DBIx-Class/0.08/branches/filter_column/lib/DBIx/Class/FilterColumn.pm 2010-04-13 16:09:57 UTC (rev 9135)
@@ -49,7 +49,7 @@
return $self->$unfilter($value);
}
-sub get_filtered_column {
+sub get_value {
my ($self, $col) = @_;
$self->throw_exception("$col is not a filtered column")
@@ -63,7 +63,7 @@
return $self->{_filtered_column}{$col} = $self->_filtered_column($col, $val);
}
-sub set_filtered_column {
+sub set_value {
my ($self, $col, $filtered) = @_;
$self->set_column($col, $self->_unfiltered_column($col, $filtered));
@@ -73,15 +73,18 @@
return $filtered;
}
-sub get_column {
- my ($self, $column) = @_;
-
- if (exists $self->{_filtered_column}{$column}) {
- return $self->store_column($column,
- $self->_unfiltered_column($column, $self->{_filtered_column}{$column}));
+sub register_column {
+ my ($class, $col, $info) = @_;
+ my $acc = $col;
+ if (exists $info->{accessor}) {
+ return unless defined $info->{accessor};
+ $acc = [ $info->{accessor}, $col ];
}
-
- return $self->next::method($column);
+ if ( exists $self->column_info($col)->{_filter_info} ) {
+ $class->mk_group_accessors(value => $acc);
+ } else {
+ $class->mk_group_accessors(column => $acc);
+ }
}
1;
Added: DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t
===================================================================
--- DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t (rev 0)
+++ DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t 2010-04-13 16:09:57 UTC (rev 9135)
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+use lib qw(t/lib);
+use DBICTest;
More information about the Bast-commits
mailing list