Subject: | missing method columns_info with DBIx::Class older than 0.08125 |
Hi Oliver,
I'm not sure if you have any intention to let AutoCRUD work with older
DBIx::Class versions, but if you od it won't work with DBIx::Class not
having 'columns_info' method (like 0.08123 present in current stable
Debian/Squeeze).
Attached is patch to use methods 'columns' and 'column_info' instead
with older versions.
Cheers,
Martin
Subject: | columns_info.patch |
--- AccessorDisplayName.pm.orig 2012-01-24 07:31:46.587916985 +0100
+++ AccessorDisplayName.pm 2012-01-24 07:36:00.619915836 +0100
@@ -22,7 +22,13 @@
my $sqlt_tbl = $sqlt->get_table($from)
or die "mismatched (accessor) table name between SQLT and DBIC: [$tbl_name]\n";
- my $columns_info = $source->columns_info;
+ # ->columns_info method is not available before DBIx::Class 0.08125
+ my $columns_info = {};
+ if ($DBIx::Class::VERSION >= 0.08125) {
+ $columns_info = $source->columns_info;
+ } else {
+ $columns_info = { map { $_ => $source->column_info($_) } $source->columns };
+ }
foreach my $field (keys %$columns_info) {
next unless exists $columns_info->{$field}->{accessor}
--- DynamicDefault.pm.orig 2012-01-24 07:16:26.495917127 +0100
+++ DynamicDefault.pm 2012-01-24 07:36:30.734118669 +0100
@@ -23,7 +23,13 @@
my $sqlt_tbl = $sqlt->get_table($from)
or die "mismatched (dyn-update) table name between SQLT and DBIC: [$tbl_name]\n";
- my $columns_info = $source->columns_info;
+ # ->columns_info method is not available before DBIx::Class 0.08125
+ my $columns_info = {};
+ if ($DBIx::Class::VERSION >= 0.08125) {
+ $columns_info = $source->columns_info;
+ } else {
+ $columns_info = { map { $_ => $source->column_info($_) } $source->columns };
+ }
foreach my $field (keys %$columns_info) {
next unless exists $columns_info->{$field}->{dynamic_default_on_create}