[Bast-commits] r9180 - 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
Thu Apr 15 14:14:28 GMT 2010
Author: frew
Date: 2010-04-15 15:14:28 +0100 (Thu, 15 Apr 2010)
New Revision: 9180
Modified:
DBIx-Class/0.08/branches/filter_column/lib/DBIx/Class/FilterColumn.pm
DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t
Log:
method and arg rename
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-15 11:09:46 UTC (rev 9179)
+++ DBIx-Class/0.08/branches/filter_column/lib/DBIx/Class/FilterColumn.pm 2010-04-15 14:14:28 UTC (rev 9180)
@@ -16,7 +16,7 @@
$self->column_info($col)->{_filter_info} = $attrs;
my $acc = $self->column_info($col)->{accessor};
- $self->mk_group_accessors('value' => [ (defined $acc ? $acc : $col), $col]);
+ $self->mk_group_accessors(filtered_column => [ (defined $acc ? $acc : $col), $col]);
return 1;
}
@@ -30,7 +30,7 @@
return $value unless exists $info->{_filter_info};
- my $filter = $info->{_filter_info}{from_storage};
+ my $filter = $info->{_filter_info}{filter_from_storage};
$self->throw_exception("No inflator for $col") unless defined $filter;
return $self->$filter($value);
@@ -44,12 +44,12 @@
return $value unless exists $info->{_filter_info};
- my $unfilter = $info->{_filter_info}{to_storage};
+ my $unfilter = $info->{_filter_info}{filter_to_storage};
$self->throw_exception("No unfilter for $col") unless defined $unfilter;
return $self->$unfilter($value);
}
-sub get_value {
+sub get_filtered_column {
my ($self, $col) = @_;
$self->throw_exception("$col is not a filtered column")
@@ -63,7 +63,7 @@
return $self->{_filtered_column}{$col} = $self->_column_from_storage($col, $val);
}
-sub set_value {
+sub set_filtered_column {
my ($self, $col, $filtered) = @_;
$self->set_column($col, $self->_column_to_storage($col, $filtered));
@@ -79,7 +79,7 @@
if ($self->has_column($key) &&
exists $self->column_info($key)->{_filter_info}) {
my $val = delete $attrs->{$key};
- $self->set_value($key, $val);
+ $self->set_filtered_column($key, $val);
$attrs->{$key} = $self->_column_to_storage($key, $val)
}
}
Modified: DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t
===================================================================
--- DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t 2010-04-15 11:09:46 UTC (rev 9179)
+++ DBIx-Class/0.08/branches/filter_column/t/row/filter_column.t 2010-04-15 14:14:28 UTC (rev 9180)
@@ -8,8 +8,8 @@
my $schema = DBICTest->init_schema();
DBICTest::Schema::Artist->load_components('FilterColumn');
DBICTest::Schema::Artist->filter_column(rank => {
- from_storage => sub { $_[1] * 2 },
- to_storage => sub { $_[1] / 2 },
+ filter_from_storage => sub { $_[1] * 2 },
+ filter_to_storage => sub { $_[1] / 2 },
});
Class::C3->reinitialize();
More information about the Bast-commits
mailing list