From 9b263a01ea91bbd01cffeee5c16ec93a12731e67 Mon Sep 17 00:00:00 2001 From: moguno Date: Sun, 26 Mar 2017 12:38:43 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AF=BE=E8=B1=A1=E3=81=8C=EF=BC=88=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=EF=BC=89=E3=81=AE=E9=96=A2=E9=80=A3=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=8C=E7=99=BA=E5=8B=95=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/plugin/intent_selector/intent_selector.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/plugin/intent_selector/intent_selector.rb b/core/plugin/intent_selector/intent_selector.rb index d028567..9959cbc 100644 --- a/core/plugin/intent_selector/intent_selector.rb +++ b/core/plugin/intent_selector/intent_selector.rb @@ -120,11 +120,11 @@ Plugin.create(:intent_selector) do # 条件に対して推奨されるintentの配列と、intentsに指定されたそれ以外の値の配列 def divide_intents(intents, uri, model_slug) intent_slugs = UserConfig[:intent_selector_rules].select{|record| - model_slug == record[:model].to_s && uri.to_s.start_with?(record[:str]) + ((record[:model] == nil) || (model_slug == record[:model].to_s)) && uri.to_s.start_with?(record[:str]) }.map{|record| record[:intent].to_sym } - intents.partition{|intent| intent_slugs.include?(intent.slug) } + intents.partition{|intent| intent_slugs.include?(intent.slug.to_sym) } end # _model_ のmodel slugを文字列で得る。 -- 2.10.1 (Apple Git-78)