Merge pull request #3325 from NobodysNightmare/feature/exclude_global_queries_from_project

hide global queries from project-scoped WP lists
pull/3283/merge
Oliver Günther 9 years ago
commit 738f5c2e56
  1. 2
      app/controllers/api/experimental/queries_controller.rb

@ -167,7 +167,7 @@ module Api::Experimental
# User can see public queries and his own queries # User can see public queries and his own queries
visible = ARCondition.new(['is_public = ? OR user_id = ?', true, (User.current.logged? ? User.current.id : 0)]) visible = ARCondition.new(['is_public = ? OR user_id = ?', true, (User.current.logged? ? User.current.id : 0)])
# Project specific queries and global queries # Project specific queries and global queries
visible << (@project.nil? ? ['project_id IS NULL'] : ['project_id IS NULL OR project_id = ?', @project.id]) visible << (@project.nil? ? ['project_id IS NULL'] : ['project_id = ?', @project.id])
@visible_queries = Query.find(:all, @visible_queries = Query.find(:all,
select: 'id, name, is_public', select: 'id, name, is_public',
order: 'name ASC', order: 'name ASC',

Loading…
Cancel
Save