From cd116a3b85eb61adec40e80789474cbc716e7993 Mon Sep 17 00:00:00 2001 From: Darin McBride Date: Thu, 1 Jan 2015 22:30:23 -0700 Subject: [PATCH] Allow for empire ID's that are negative, and allow the optional '#' to signify it's an ID (but optional because it's annoying 99% of the time). --- lib/Lacuna/DB.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Lacuna/DB.pm b/lib/Lacuna/DB.pm index a851330f..da0e5c06 100644 --- a/lib/Lacuna/DB.pm +++ b/lib/Lacuna/DB.pm @@ -27,14 +27,14 @@ sub _where elsif ($id =~ /[%_]/) { $where{$type} = { like => $id }; } - # or just the name (hopefully no names are purely numeric) - elsif ($id =~ /\D/) { - $where{$type} = $id; - } # or the numeric ID (probably most useful for testing) - else { + elsif ($id =~ /^#?-?\d+$/) { $where{id} = $id; } + # or just the name (hopefully no names are purely numeric) + else { + $where{$type} = $id; + } \%where; } -- 2.51.2