Skip to content

Commit

Permalink
New version, some reverts, seems to work
Browse files Browse the repository at this point in the history
  • Loading branch information
ambs committed Sep 2, 2015
1 parent 0c46dfb commit 8ed3d94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Dancer2/Changes
@@ -1,5 +1,10 @@
Revision history for Dancer2-Plugin-Database

2.13 2015-10-02
[ BUG FIXES ]
- Require Dancer::Plugin::Database::Core v0.12, that
fixes logging problems

2.12 2014-10-13
[ BUG FIXES ]
- Fixed dependency for Plack::Test.
Expand Down
2 changes: 1 addition & 1 deletion Dancer2/Makefile.PL
Expand Up @@ -13,7 +13,7 @@ WriteMakefile(
PL_FILES => {},
PREREQ_PM => {
'Dancer2' => '0.151000',
'Dancer::Plugin::Database::Core' => '0.08',
'Dancer::Plugin::Database::Core' => '0.12',
},
TEST_REQUIRES => {
'Test::More' => 0,
Expand Down
11 changes: 7 additions & 4 deletions Dancer2/lib/Dancer2/Plugin/Database.pm
Expand Up @@ -15,7 +15,7 @@ Dancer2::Plugin::Database - easy database connections for Dancer2 applications
=cut

our $VERSION = '2.12';
our $VERSION = '2.13';

register_hook qw(database_connected
database_connection_lost
Expand All @@ -25,12 +25,11 @@ register_hook qw(database_connected

my $settings = {};


on_plugin_import {
sub _load_settings {
my $dsl = shift;
$settings = plugin_setting();
$settings->{charset} ||= $dsl->setting('charset') || 'utf-8';
};
}

register database => sub {
my $dsl = shift;
Expand All @@ -45,6 +44,10 @@ register database => sub {
$dsl->execute_hook(@_);
};

## This is mostly for the case the user uses 'set plugins' and
## changes configuration during runtime. For example in our test suite.
_load_settings($dsl);

my ($dbh, $cfg) = Dancer::Plugin::Database::Core::database( arg => $_[0],
logger => $logger,
hook_exec => $hook_exec,
Expand Down

0 comments on commit 8ed3d94

Please sign in to comment.