- is_deferable support on relations used by the SQL::Translator
parser (Anders Nor Berle)
- Refactored DBIx::Class::Schema::Versioned
+ - Syntax errors from resultset components are now reported correctly
0.08010 2008-03-01 10:30
- Fix t/94versioning.t so it passes with latest SQL::Translator
sub throw_exception {
my $self=shift;
- $self->_source_handle->schema->throw_exception(@_);
+ if (ref $self) {
+ $self->_source_handle->schema->throw_exception(@_)
+ } else {
+ croak(@_);
+ }
+
}
# XXX: FIXME: Attributes docs need clearing up
my $schema = DBICTest->init_schema();
-plan tests => 19;
+plan tests => 20;
# Test ensure_class_found
ok( $schema->ensure_class_found('DBIx::Class::Schema'),
'load_optional_class(DBICTest::SyntaxErrorComponent2) threw ok' );
}
+
+eval {
+ package Fake::ResultSet;
+
+ use base 'DBIx::Class::ResultSet';
+
+ __PACKAGE__->load_components('+DBICTest::SyntaxErrorComponent3');
+};
+
+# Make sure the errors in components of resultset classes are reported right.
+like($@, qr!\Qsyntax error at t/lib/DBICTest/SyntaxErrorComponent3.pm!, "Errors from RS components reported right");
+
1;
+++ /dev/null
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-use lib qw(t/lib);
-eval {
- package DBICErrorTest::Schema;
-
- use base 'DBIx::Class::Schema';
- __PACKAGE__->load_classes('SourceWithError');
-};
-
-# Make sure the errors in components of resultset classes are reported right.
-like($@, qr!syntax error at t/lib/DBICErrorTest/SyntaxError.pm!);
+++ /dev/null
-package DBICErrorTest::ResultSet::WithError;
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class::ResultSet';
-
-__PACKAGE__->load_components('+DBICErrorTest::SyntaxError');
-
-1;
+++ /dev/null
-package DBICErrorTest::Schema::SourceWithError;
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-__PACKAGE__->load_components('Core');
-__PACKAGE__->table('foo');
-#__PACKAGE__->load_components('+DBICErrorTest::SyntaxError');
-require DBICErrorTest::ResultSet::WithError;
-__PACKAGE__->resultset_class('DBICErrorTest::ResultSet::WithError');
-
-1;