Extract default scope from the tasks controller

Place refactored code into the tasks model to make the controller more concise.
Use def with parentheses when there are parameters.