X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FModel%2FDBIC%2FSchema%2FTypes.pm;h=dae2da48f93e813083f1cdb1dec8e8595d625899;hb=9ee0a8684abce91b46f4d0769db2e394e18ab4a9;hp=0bf8c3bb7b33d1539d638a9ff1c0007f2b75aa87;hpb=2fa0a1f11f9a8e53c107f407e4bfdc8715114b23;p=catagits%2FCatalyst-Model-DBIC-Schema.git diff --git a/lib/Catalyst/Model/DBIC/Schema/Types.pm b/lib/Catalyst/Model/DBIC/Schema/Types.pm index 0bf8c3b..dae2da4 100644 --- a/lib/Catalyst/Model/DBIC/Schema/Types.pm +++ b/lib/Catalyst/Model/DBIC/Schema/Types.pm @@ -3,6 +3,7 @@ package # hide from PAUSE use MooseX::Types -declare => [qw/ ConnectInfo ConnectInfos Replicants SchemaClass LoadedClass CreateOption + Schema /]; use Carp::Clan '^Catalyst::Model::DBIC::Schema'; @@ -25,6 +26,8 @@ subtype SchemaClass, SchemaClass->coercion(LoadedClass->coercion); +class_type Schema, { class => 'DBIx::Class::Schema' }; + subtype ConnectInfo, as HashRef, where { exists $_->{dsn} || exists $_->{dbh_maker} }, @@ -54,6 +57,8 @@ coerce ConnectInfos, via { [ _coerce_connect_info_from_str() ] }, from CodeRef, via { [ +{ dbh_maker => $_ } ] }, + from HashRef, + via { [ $_ ] }, from ArrayRef, via { [ map { !ref $_ ? _coerce_connect_info_from_str()