[Bast-commits] r3275 - in branches/DBIx-Class-current: .
lib/DBIx/Class t
claco at dev.catalyst.perl.org
claco at dev.catalyst.perl.org
Thu May 10 01:18:36 GMT 2007
Author: claco
Date: 2007-05-10 01:18:35 +0100 (Thu, 10 May 2007)
New Revision: 3275
Added:
branches/DBIx-Class-current/t/resultset_class.t
Modified:
branches/DBIx-Class-current/Changes
branches/DBIx-Class-current/Makefile.PL
branches/DBIx-Class-current/lib/DBIx/Class/ResultSource.pm
Log:
resultset_class/result_class now (again) auto loads the specified class; requires Class::Accessor::Grouped 0.05000+
Modified: branches/DBIx-Class-current/Changes
===================================================================
--- branches/DBIx-Class-current/Changes 2007-05-09 22:42:11 UTC (rev 3274)
+++ branches/DBIx-Class-current/Changes 2007-05-10 00:18:35 UTC (rev 3275)
@@ -8,6 +8,8 @@
- The SQL::T parser class now respects a relationship attribute of
is_foreign_key_constrain to allow explicit control over wether or
not a foreign constraint is needed
+ - resultset_class/result_class now (again) auto loads the specified
+ class; requires Class::Accessor::Grouped 0.05000+
0.07006 2007-04-17 23:18:00
- Lots of documentation updates
@@ -308,7 +310,8 @@
0.05002 2006-02-06 12:12:03
- Added recommends for Class::Inspector
- - Added skip_all to t/40resultsetmanager.t if no Class::Inspector available
+ - Added skip_all to t/40resultsetmanager.t if no Class::Inspector
+ available
0.05001 2006-02-05 15:28:10
- debug output now prints NULL for undef params
@@ -348,8 +351,10 @@
0.04999_04 2006-01-24 21:48:21
- more documentation improvements
- - add columns_info_for for vendor-specific column info (Zbigniew Lukasiak)
- - add SQL::Translator::Producer for DBIx::Class table classes (Jess Robinson)
+ - add columns_info_for for vendor-specific column info (Zbigniew
+ Lukasiak)
+ - add SQL::Translator::Producer for DBIx::Class table classes (Jess
+ Robinson)
- add unique constraint declaration (Daniel Westermann-Clark)
- add new update_or_create method (Daniel Westermann-Clark)
- rename ResultSetInstance class to ResultSetProxy, ResultSourceInstance
@@ -359,11 +364,13 @@
0.04999_03 2006-01-20 06:05:27
- imported Jess Robinson's SQL::Translator::Parser::DBIx::Class
- - lots of internals cleanup to eliminate result_source_instance requirement
+ - lots of internals cleanup to eliminate result_source_instance
+ requirement
- added register_column and register_relationship class APIs
- made Storage::DBI use prepare_cached safely (thanks to Tim Bunce)
- many documentation improvements (thanks guys!)
- - added ->connection, ->connect, ->register_source and ->clone schema methods
+ - added ->connection, ->connect, ->register_source and ->clone schema
+ methods
- Use croak instead of die for user errors.
0.04999_02 2006-01-14 07:17:35
@@ -436,3 +443,4 @@
0.01 2005-08-08 17:10:00
- initial release
+
Modified: branches/DBIx-Class-current/Makefile.PL
===================================================================
--- branches/DBIx-Class-current/Makefile.PL 2007-05-09 22:42:11 UTC (rev 3274)
+++ branches/DBIx-Class-current/Makefile.PL 2007-05-10 00:18:35 UTC (rev 3275)
@@ -15,7 +15,7 @@
requires 'DBI' => 1.40;
requires 'Module::Find' => 0;
requires 'Class::Inspector' => 0;
-requires 'Class::Accessor::Grouped' => 0.03;
+requires 'Class::Accessor::Grouped' => 0.05000;
requires 'JSON' => 1.00;
# Perl 5.8.0 doesn't have utf8::is_utf8()
Modified: branches/DBIx-Class-current/lib/DBIx/Class/ResultSource.pm
===================================================================
--- branches/DBIx-Class-current/lib/DBIx/Class/ResultSource.pm 2007-05-09 22:42:11 UTC (rev 3274)
+++ branches/DBIx-Class-current/lib/DBIx/Class/ResultSource.pm 2007-05-10 00:18:35 UTC (rev 3275)
@@ -14,7 +14,7 @@
_columns _primaries _unique_constraints name resultset_attributes
schema from _relationships column_info_from_storage source_info/);
-__PACKAGE__->mk_group_accessors('inherited' => qw/resultset_class
+__PACKAGE__->mk_group_accessors('component_class' => qw/resultset_class
result_class/);
__PACKAGE__->mk_group_ro_accessors('simple' => qw/source_name/);
Added: branches/DBIx-Class-current/t/resultset_class.t
===================================================================
--- branches/DBIx-Class-current/t/resultset_class.t (rev 0)
+++ branches/DBIx-Class-current/t/resultset_class.t 2007-05-10 00:18:35 UTC (rev 3275)
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More;
+use Class::Inspector ();
+
+unshift(@INC, './t/lib');
+use lib 't/lib';
+plan tests => 5;
+
+use DBICTest;
+
+is(DBICTest::Schema->source('Artist')->resultset_class, 'DBIx::Class::ResultSet', 'default resultset class');
+ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded');
+DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A');
+ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded automatically');
+is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICNSTest::ResultSet::A', 'custom resultset class set');
+
+my $schema = DBICTest->init_schema;
+my $resultset = $schema->resultset('Artist')->search;
+isa_ok($resultset, 'DBICNSTest::ResultSet::A', 'resultset is custom class');
More information about the Bast-commits
mailing list