Skip to content

Commit

Permalink
Fix event log error
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioribeiro committed Nov 23, 2015
1 parent 2294e62 commit 0c7bda1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Data/Repositories/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace PragmaRX\Tracker\Data\Repositories;

class Log extends Repository {

class Log extends Repository
{
private $currentLogId = null;

public function updateRoute($route_path_id)
Expand Down Expand Up @@ -95,7 +95,8 @@ public function allByRouteName($name, $minutes = null)

public function delete()
{
$this->currentLogId = null;

$this->getModel()->delete();
}

}
9 changes: 8 additions & 1 deletion src/Data/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ public function create($attributes, $model = null)
}
}

$model->save();
try
{
$model->save();
}
catch(\Exception $e)
{
$model->save();
}

return $model;
}
Expand Down

0 comments on commit 0c7bda1

Please sign in to comment.