move ids_from_string to query instance
This commit is contained in:
parent
801e292020
commit
7c17cf5e0d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user