summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Tags/Lib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNWeb/Tags/Lib.pm')
-rw-r--r--lib/VNWeb/Tags/Lib.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/VNWeb/Tags/Lib.pm b/lib/VNWeb/Tags/Lib.pm
index 61220186..e9935629 100644
--- a/lib/VNWeb/Tags/Lib.pm
+++ b/lib/VNWeb/Tags/Lib.pm
@@ -3,7 +3,7 @@ package VNWeb::Tags::Lib;
use VNWeb::Prelude;
use Exporter 'import';
-our @EXPORT = qw/ tagscore_ /;
+our @EXPORT = qw/ tagscore_ enrich_group /;
sub tagscore_ {
my($s, $ign) = @_;
@@ -13,4 +13,11 @@ sub tagscore_ {
};
}
+
+# Add a 'group' name for traits
+sub enrich_group {
+ my($type, @lst) = @_;
+ enrich_merge id => 'SELECT t.id, g.name AS "group" FROM traits t JOIN traits g ON g.id = t."group" WHERE t.id IN', @lst if $type eq 'i';
+}
+
1;