Module: ForemanTasks::FindTasksCommon
- Included in:
- Api::TasksController, TasksController
- Defined in:
- app/controllers/concerns/foreman_tasks/find_tasks_common.rb
Instance Method Summary collapse
Instance Method Details
#current_taxonomy_search ⇒ Object
7 8 9 10 11 12 |
# File 'app/controllers/concerns/foreman_tasks/find_tasks_common.rb', line 7 def current_taxonomy_search conditions = [] conditions << "organization_id = #{Organization.current.id}" if Organization.current conditions << "location_id = #{Location.current.id}" if Location.current conditions.empty? ? '' : "(#{conditions.join(' AND ')})" end |
#search_query ⇒ Object
3 4 5 |
# File 'app/controllers/concerns/foreman_tasks/find_tasks_common.rb', line 3 def search_query [current_taxonomy_search, params[:search]].select(&:present?).join(' AND ') end |