From 7d5e8897d841f2cf3e2b033e94587a03e38af2bc Mon Sep 17 00:00:00 2001 From: Dmitry Medvinsky Date: Thu, 28 Apr 2016 12:02:01 +0400 Subject: [PATCH] Fix search in Redmine 3.2.1 Scope lambdas in search are passed an `options` argument, but lambdas defined in `init.rb` don't accept any arguments. Since they are lambdas, the arguments are validated at runtime and it fails with exception. Simply changing them to lambdas fixes the issue. Related line from Redmine: https://github.com/redmine/redmine/blob/fcb4e510ea3c4de06aa7dfad31c772ad589fd612/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb#L186 --- init.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.rb b/init.rb index 8b7415e..446736b 100644 --- a/init.rb +++ b/init.rb @@ -15,7 +15,7 @@ Issue.searchable_options[:include] << :issue_tags # For redmine > 3 - Issue.searchable_options[:scope] = -> { Issue.includes(:issue_tags) } + Issue.searchable_options[:scope] = proc { Issue.includes(:issue_tags) } end unless WikiPage.searchable_options[:include] && WikiPage.searchable_options[:include].include?(:wiki_page_tags) @@ -26,7 +26,7 @@ WikiPage.searchable_options[:include] << :wiki_page_tags # For redmine > 3 - WikiPage.searchable_options[:scope] = -> { WikiPage.includes(:wiki_page_tags) } + WikiPage.searchable_options[:scope] = proc { WikiPage.includes(:wiki_page_tags) } end end