summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Tags.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-02-15 11:55:48 +0100
committerYorhel <git@yorhel.nl>2009-02-15 11:55:48 +0100
commit18672f0ae09f3669f483bb214f672932f57fe12f (patch)
treeb6d5a62763b80eb9bd7c8f77904547840f8044a5 /lib/VNDB/DB/Tags.pm
parent678b6c3089cd4372ca9e4bd48e629d46a6549c1a (diff)
Check for existing tag with the same name on tag creation or edit
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r--lib/VNDB/DB/Tags.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm
index a4dc712b..9b9a94ae 100644
--- a/lib/VNDB/DB/Tags.pm
+++ b/lib/VNDB/DB/Tags.pm
@@ -8,7 +8,7 @@ use Exporter 'import';
our @EXPORT = qw|dbTagGet dbTagEdit dbTagAdd|;
-# %options->{ id page results order what }
+# %options->{ id name page results order what }
# what: parents childs(n)
sub dbTagGet {
my $self = shift;
@@ -23,6 +23,8 @@ sub dbTagGet {
my %where = (
$o{id} ? (
't.id = ?' => $o{id} ) : (),
+ $o{name} ? (
+ 'lower(t.name) = ?' => lc $o{name} ) : (),
);
my($r, $np) = $self->dbPage(\%o, q|