From 42ca4b6790baf76f507cc3675f4a171223cfde4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 18 Sep 2013 11:22:34 +0200 Subject: [PATCH] =?utf8?q?CustomVariables-Helper=20richtigen=20Accessor=20?= =?utf8?q?f=C3=BCr=20=C3=BCberladenen=20Cvars=20machen=20lassen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Helper/CustomVariables.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/DB/Helper/CustomVariables.pm b/SL/DB/Helper/CustomVariables.pm index 3c43624db..373a60cf1 100644 --- a/SL/DB/Helper/CustomVariables.pm +++ b/SL/DB/Helper/CustomVariables.pm @@ -42,8 +42,11 @@ sub save_meta_info { sub make_cvar_accessor { my ($caller_package, %params) = @_; - my @module_filter = $params{module} ? - ("config_id" => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = '$params{module}')" ]) : + my $modules = ('ARRAY' eq ref $params{module}) ? + join ',', @{ $params{module} } : + $params{module}; + my @module_filter = $modules ? + ("config_id" => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module IN ( '$modules' ))" ]) : # " make emacs happy (); $caller_package->meta->add_relationships( -- 2.20.1