Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.2' into 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 2, 2016
2 parents a882241 + 8116de4 commit 0683b59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ protected function incrementOrDecrementAttributeValue($column, $amount, $method)
public function update(array $attributes = [], array $options = [])
{
if (! $this->exists) {
return $this->newQuery()->update($attributes);
return false;
}

return $this->fill($attributes)->save($options);
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ public function getUri()
* Set the URI that the route responds to.
*
* @param string $uri
* @return \Illuminate\Routing\Route
* @return $this
*/
public function setUri($uri)
{
Expand Down Expand Up @@ -798,7 +798,7 @@ public function name($name)
* Set the handler for the route.
*
* @param \Closure|string $action
* @return \Illuminate\Routing\Route
* @return $this
*/
public function uses($action)
{
Expand Down
6 changes: 6 additions & 0 deletions tests/Database/DatabaseEloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,12 @@ public function testModelAttributeCastingPreservesNull()
$this->assertNull($array['timestampAttribute']);
}

public function testUpdatingNonExistentModelFails()
{
$model = new EloquentModelStub;
$this->assertFalse($model->update());
}

protected function addMockConnection($model)
{
$model->setConnectionResolver($resolver = m::mock('Illuminate\Database\ConnectionResolverInterface'));
Expand Down

0 comments on commit 0683b59

Please sign in to comment.