[Catalyst-commits] r11443 - in trunk/Catalyst-Model-DBI: .
lib/Catalyst/Helper/Model lib/Catalyst/Model
alex at dev.catalyst.perl.org
alex at dev.catalyst.perl.org
Sat Oct 3 21:29:20 GMT 2009
Author: alex
Date: 2009-10-03 21:29:19 +0000 (Sat, 03 Oct 2009)
New Revision: 11443
Modified:
trunk/Catalyst-Model-DBI/Changes
trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm
trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm
Log:
new patches
Modified: trunk/Catalyst-Model-DBI/Changes
===================================================================
--- trunk/Catalyst-Model-DBI/Changes 2009-10-01 19:25:56 UTC (rev 11442)
+++ trunk/Catalyst-Model-DBI/Changes 2009-10-03 21:29:19 UTC (rev 11443)
@@ -1,5 +1,9 @@
Revision history for Perl extension Catalyst::Model::DBI.
- - Switch from NEXT to next::method
+0.22 Fri Oct 02 10:00:00 2008
+ - Change from NEXT to MRO::Compat
+0.21 Fri Oct 02 10:00:00 2008
+ - Added support for configs named either "user" or "username" and "password" or "pass"
+ - Updated the helper to use parent instead of base
0.20 Sun Dec 07 17:36:00 2008
- fixed issue: http://rt.cpan.org/Public/Bug/Display.html?id=38121
- fixed issue: http://rt.cpan.org/Public/Bug/Display.html?id=39884
Modified: trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm
===================================================================
--- trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm 2009-10-01 19:25:56 UTC (rev 11442)
+++ trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm 2009-10-03 21:29:19 UTC (rev 11443)
@@ -3,7 +3,7 @@
use strict;
use File::Spec;
-our $VERSION = '0.20';
+our $VERSION = '0.22';
=head1 NAME
@@ -66,7 +66,8 @@
package [% class %];
use strict;
-use base 'Catalyst::Model::DBI';
+use warnings;
+use parent 'Catalyst::Model::DBI';
__PACKAGE__->config(
dsn => '[% dsn %]',
Modified: trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm
===================================================================
--- trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm 2009-10-01 19:25:56 UTC (rev 11442)
+++ trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm 2009-10-03 21:29:19 UTC (rev 11443)
@@ -5,7 +5,7 @@
use MRO::Compat;
use DBI;
-our $VERSION = '0.20';
+our $VERSION = '0.22';
__PACKAGE__->mk_accessors( qw/_dbh _pid _tid/ );
@@ -16,7 +16,7 @@
=head1 SYNOPSIS
# use the helper
- create model DBI DBI dsn user password
+ create model DBI DBI dsn username password
# lib/MyApp/Model/DBI.pm
package MyApp::Model::DBI;
@@ -26,7 +26,7 @@
__PACKAGE__->config(
dsn => 'dbi:Pg:dbname=myapp',
password => '',
- user => 'postgres',
+ username => 'postgres',
options => { AutoCommit => 1 },
);
@@ -52,7 +52,7 @@
sub new {
my $self = shift;
my ( $c ) = @_;
- $self = $self->next::method( @_ );
+ $self = $self->NEXT::new( @_ );
$self->{namespace} ||= ref $self;
$self->{additional_base_classes} ||= ();
$self->{log} = $c->log;
@@ -117,8 +117,8 @@
eval {
$dbh = DBI->connect(
$self->{dsn},
- $self->{user},
- $self->{password},
+ $self->{username} || $self->{user},
+ $self->{password} || $self->{pass},
$self->{options}
);
};
More information about the Catalyst-commits
mailing list