Skip to content

Commit

Permalink
Merge pull request #5 from nicqrocks/patch-2
Browse files Browse the repository at this point in the history
Fix trouble with multiple models
  • Loading branch information
tony-o committed Dec 7, 2018
2 parents a5f0cd7 + 05f65c2 commit 8ccb40c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Hiker.pm6
Expand Up @@ -91,7 +91,7 @@ class Hiker {
my $model;
try {
CATCH { default { warn $_; } }
$model = .values.grep({ .^name eq ( $obj.^can('model') ?? $obj.model !! '' ) })[0].new
$model //= .values.grep({ .^name eq ( $obj.^can('model') ?? $obj.model !! '' ) })[0].new
for @models;
}
route $obj.path, sub ($req, $res) {
Expand Down

0 comments on commit 8ccb40c

Please sign in to comment.