In various places we check if the same relation would return projects.
This is done using "any?" which will run a COUNT query with any
LIMIT/OFFSET values still applied.
To work around all this we introduce 2 helper methods that take care of
doing the right thing. This leads to the produced queries being simpler
and fewer queries being executed.
When creating new issue from dashboard page I want to see projects
sorted by last activity instead of ID
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>