Fixes the tests.

This commit is contained in:
James Cole
2014-08-20 18:12:40 +02:00
parent c272d99fa8
commit 119930399a
2 changed files with 8 additions and 5 deletions

View File

@@ -10,7 +10,6 @@ class BaseController extends Controller
* *
*/ */
public function __construct() { public function __construct() {
parent::__construct();
Event::fire('limits.check'); Event::fire('limits.check');
} }
/** /**

View File

@@ -19,10 +19,14 @@ class EloquentLimitTrigger
*/ */
public function checkRepeatingLimits() public function checkRepeatingLimits()
{ {
$limits = \Limit::leftJoin('components', 'components.id', '=', 'limits.component_id') if (\Auth::check()) {
->where('components.user_id', \Auth::user()->id) $limits = \Limit::leftJoin('components', 'components.id', '=', 'limits.component_id')
->where('limits.repeats', 1) ->where('components.user_id', \Auth::user()->id)
->get(['limits.*']); ->where('limits.repeats', 1)
->get(['limits.*']);
} else {
$limits = [];
}
/** @var \Limit $limit */ /** @var \Limit $limit */
foreach ($limits as $limit) { foreach ($limits as $limit) {