[Catalyst-commits] r12516 - in trunk/Catalyst-Model-CDBI: . lib/Catalyst/Model t

arathorn at dev.catalyst.perl.org arathorn at dev.catalyst.perl.org
Sun Jan 3 21:58:55 GMT 2010


Author: arathorn
Date: 2010-01-03 21:58:55 +0000 (Sun, 03 Jan 2010)
New Revision: 12516

Modified:
   trunk/Catalyst-Model-CDBI/Changes
   trunk/Catalyst-Model-CDBI/META.yml
   trunk/Catalyst-Model-CDBI/lib/Catalyst/Model/CDBI.pm
   trunk/Catalyst-Model-CDBI/t/01use.t
Log:
Work around CDBI incompatibility with C3 mro

Modified: trunk/Catalyst-Model-CDBI/Changes
===================================================================
--- trunk/Catalyst-Model-CDBI/Changes	2010-01-03 14:55:40 UTC (rev 12515)
+++ trunk/Catalyst-Model-CDBI/Changes	2010-01-03 21:58:55 UTC (rev 12516)
@@ -1,6 +1,8 @@
 Revision history for Perl extension Catalyst::Model::CDBI.
+0.12
+    - Work around MRO problems in CDBI by massaging CDBI::__::Base's ISA
 
-0.11
+0.11  Wed Nov 23 09:46:00 2005
     - Throw an exception during startup if there is an error loading
       tables.
 

Modified: trunk/Catalyst-Model-CDBI/META.yml
===================================================================
--- trunk/Catalyst-Model-CDBI/META.yml	2010-01-03 14:55:40 UTC (rev 12515)
+++ trunk/Catalyst-Model-CDBI/META.yml	2010-01-03 21:58:55 UTC (rev 12516)
@@ -8,6 +8,7 @@
     Catalyst:                      4.00
     Class::DBI:                    0
     Class::DBI::Loader:            0.2
+    MRO::Compat:                   0.11
 
 distribution_type: module
 generated_by: ExtUtils::MakeMaker version 6.17

Modified: trunk/Catalyst-Model-CDBI/lib/Catalyst/Model/CDBI.pm
===================================================================
--- trunk/Catalyst-Model-CDBI/lib/Catalyst/Model/CDBI.pm	2010-01-03 14:55:40 UTC (rev 12515)
+++ trunk/Catalyst-Model-CDBI/lib/Catalyst/Model/CDBI.pm	2010-01-03 21:58:55 UTC (rev 12516)
@@ -1,11 +1,20 @@
 package Catalyst::Model::CDBI;
 
+# work around CDBI being incompatible with C3 mro, due to both Ima::DBI and Class::DBI::__::Base
+# inheriting from Class::Data::Inheritable in an inconsistent order.
+BEGIN {
+    require Class::DBI;
+    @Class::DBI::__::Base::ISA = grep { $_ ne 'Class::Data::Inheritable' } @Class::DBI::__::Base::ISA;
+}
+
 use strict;
+# XXX: this should be migrated to Catalyst::Component
 use base qw/Catalyst::Base Class::DBI/;
+# XXX: this should be migrated away from using NEXT in favour of mro
 use NEXT;
 use Class::DBI::Loader;
 
-our $VERSION = '0.11';
+our $VERSION = '0.12';
 
 __PACKAGE__->mk_accessors('loader');
 
@@ -84,8 +93,17 @@
 
 Sebastian Riedel, C<sri at cpan.org>
 
+=head1 CONTRIBUTORS
+
+mst: Matt S Trout C<mst at shadowcat.co.uk>
+
+Arathorn: Matthew Hodgson C<matthew at arasphere.net>
+
 =head1 COPYRIGHT
 
+Copyright (c) 2005 - 2010 the Catalyst::Model::CDBI L</AUTHOR> and
+L</CONTRIBUTORS> as listed above.
+
 This program is free software, you can redistribute it and/or modify it 
 under the same terms as Perl itself.
 

Modified: trunk/Catalyst-Model-CDBI/t/01use.t
===================================================================
--- trunk/Catalyst-Model-CDBI/t/01use.t	2010-01-03 14:55:40 UTC (rev 12515)
+++ trunk/Catalyst-Model-CDBI/t/01use.t	2010-01-03 21:58:55 UTC (rev 12516)
@@ -1,5 +1,8 @@
 use strict;
-use Test::More tests => 2;
+use Test::More tests => 3;
 
 BEGIN { use_ok('Catalyst::Model::CDBI') }
 BEGIN { use_ok('Catalyst::Helper::Model::CDBI') }
+
+use MRO::Compat;
+ok(eval { mro::get_linear_isa('Catalyst::Model::CDBI'); 1 }, 'Linearise ok');




More information about the Catalyst-commits mailing list