provide sql_for_enabled_module

This commit is contained in:
Alexander Meindl 2019-05-22 12:26:14 +02:00
parent d0d219d5f2
commit a6e5f9b5c3
2 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,18 @@ module AdditionalsQuery
end
module InstanceMethods
def sql_for_enabled_module(table_field, module_names)
module_names = Array(module_names)
sql = []
module_names.each do |module_name|
sql << "EXISTS(SELECT 1 FROM #{EnabledModule.table_name} WHERE #{EnabledModule.table_name}.project_id=#{table_field}" \
" AND #{EnabledModule.table_name}.name='#{module_name}')"
end
sql.join(' AND ')
end
def initialize_ids_filter(options = {})
if options[:label]
add_available_filter 'ids', type: :integer, label: options[:label]

View File

@ -149,7 +149,6 @@ Features
* configurable issue rules
* freeze closed issue
* closing issue with open sub issues
* change assigned_to automatically, if issue status changes
* assigned_to has changed, but status change is required, too