diff --git a/app/models/additionals_query.rb b/app/models/additionals_query.rb index dbbc9918..230c6a0f 100644 --- a/app/models/additionals_query.rb +++ b/app/models/additionals_query.rb @@ -59,7 +59,7 @@ module AdditionalsQuery def sql_for_ids_field(_field, operator, value) if operator == '=' # accepts a comma separated list of ids - ids = Additionals.ids_from_string value.first + ids = ids_from_string value.first if ids.any? "#{queried_table_name}.id IN (#{ids.join ','})" else diff --git a/lib/additionals.rb b/lib/additionals.rb index c1566f20..f706b3db 100644 --- a/lib/additionals.rb +++ b/lib/additionals.rb @@ -47,10 +47,6 @@ module Additionals [value, options] end - def ids_from_string(string) - string.to_s.scan(/\d+/).map(&:to_i) - end - def split_ids(phrase, limit: nil) limit ||= Setting.per_page_options_array.first || 25 raw_ids = phrase.strip_split diff --git a/lib/additionals/patches/query_patch.rb b/lib/additionals/patches/query_patch.rb index 08dca36e..d5e6fba2 100644 --- a/lib/additionals/patches/query_patch.rb +++ b/lib/additionals/patches/query_patch.rb @@ -61,6 +61,10 @@ module Additionals @available_filters end + def ids_from_string(string) + string.to_s.scan(/\d+/).map(&:to_i) + end + def export_limit Setting.issues_export_limit.to_i end