Skip to content

Commit

Permalink
re-arranged types in a logical matter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Henning Thorsen committed Aug 12, 2010
1 parent bbdda28 commit 5bea5fc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/DBIx/Class/Admin/Types.pm
Expand Up @@ -12,13 +12,13 @@ use MooseX::Types::JSON qw(JSON);
subtype DBICArrayRef,
as ArrayRef;

subtype DBICHashRef,
as HashRef;

coerce DBICArrayRef,
from JSON,
via { _json_to_data ($_) };

subtype DBICHashRef,
as HashRef;

coerce DBICHashRef,
from JSON,
via { _json_to_data($_) };
Expand All @@ -28,15 +28,12 @@ subtype DBICConnectInfo,

coerce DBICConnectInfo,
from JSON,
via { return _json_to_data($_) } ;

coerce DBICConnectInfo,
via { return _json_to_data($_) },
from Str,
via { return _json_to_data($_) };

coerce DBICConnectInfo,
via { return _json_to_data($_) },
from HashRef,
via { [ $_ ] };
via { [ $_ ] }
;

sub _json_to_data {
my ($json_str) = @_;
Expand Down

0 comments on commit 5bea5fc

Please sign in to comment.