Skip to content

Commit

Permalink
use sub instead of Type::Tiny isa check for Product->quantity
Browse files Browse the repository at this point in the history
Workaround for #28 until time is available to investigate fully.
  • Loading branch information
SysPete committed Sep 28, 2015
1 parent a8b8e04 commit fff7596
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/Interchange6/Cart/Product.pm
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,16 @@ than zero. Default for quantity is 1.
=cut

has quantity => (
is => 'ro',
isa => PositiveInt,
is => 'ro',
# The following isa check is failing on some smokers for an (as yet)
# unknown reason. See:
# https://github.com/interchange/Interchange6/issues/28
# so for now we use a sub instead of the Type::Tiny type
#isa => PositiveInt,
isa => sub {
die "quantity must be a positive integer"
unless ( $_[0] && $_[0] =~ /^\d+$/ )
},
default => 1,
writer => 'set_quantity',
);
Expand Down

0 comments on commit fff7596

Please sign in to comment.