What about cases where someone might use Storable and base64 together?
column prefs =>
type is 'text',
filters are qw/
Jifty::DBI::Filter::Storable
Jifty::DBI::Filter::base64
/;
It also seems like this patch breaks the separation of concerns between
the filter and record classes. If there's going to be error checking
about the column being the correct type for a filter, it needs to be a
check done by the filter.
Cheers,
Sterling
--
Andrew Sterling Hanenkamp
Interaction Developer
Boomer Consulting, Inc.
1.785.537.2358 ext. 17
1.888.266.6375 ext. 17
1.785.537.4545 (fax)
610 Humboldt
Manhattan, KS 66502
http://www.boomer.com/about/team/andrew-hanenkamp.html
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, February 27, 2007 9:07 PM
To: [EMAIL PROTECTED]
Subject: [Jifty-commit] r2859 - in Jifty-DBI/trunk: lib/Jifty/DBI
Author: trs
Date: Tue Feb 27 22:07:09 2007
New Revision: 2859
Modified:
Jifty-DBI/trunk/ (props changed)
Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
Log:
[EMAIL PROTECTED]: tom | 2007-02-27 22:07:00 -0500 Die on incorrect column
type when using the Storable filter
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
========================================================================
======
--- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm Tue Feb 27 22:07:09 2007
@@ -236,6 +236,15 @@
# through add_column
$column->record_class( $package ) if not $column->record_class;
+ # Check for the correct column type when the Storable filter is in
use
+ if ( grep { $_ eq 'Jifty::DBI::Filter::Storable' }
+ ($column->input_filters, $column->output_filters)
+ and $column->type !~ /^(blob|bytea)$/i)
+ {
+ die "Column '$column_name' in @{[$column->record_class]} ".
+ "uses the Storable filter but is not of type 'blob'.\n";
+ }
+
no strict 'refs'; # We're going to be defining subs
if ( not $self->can($column_name) ) {
_______________________________________________
Jifty-commit mailing list
[EMAIL PROTECTED]
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
_______________________________________________
jifty-devel mailing list
[email protected]
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel