diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php index 02bcd723d230..a71b022950d6 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -1242,7 +1242,7 @@ public function updatedAt() */ public function getRelatedFreshUpdate() { - return [$this->related->getUpdatedAtColumn() => $this->related->freshTimestamp()]; + return [$this->related->getUpdatedAtColumn() => $this->related->freshTimestampString()]; } /** diff --git a/tests/Database/DatabaseEloquentBelongsToManyTest.php b/tests/Database/DatabaseEloquentBelongsToManyTest.php index 5b520cecfdd1..e49663836fa0 100755 --- a/tests/Database/DatabaseEloquentBelongsToManyTest.php +++ b/tests/Database/DatabaseEloquentBelongsToManyTest.php @@ -521,13 +521,13 @@ public function testTouchMethodSyncsTimestamps() { $relation = $this->getRelation(); $relation->getRelated()->shouldReceive('getUpdatedAtColumn')->andReturn('updated_at'); - $relation->getRelated()->shouldReceive('freshTimestamp')->andReturn(100); + $relation->getRelated()->shouldReceive('freshTimestampString')->andReturn('100'); $relation->getRelated()->shouldReceive('getQualifiedKeyName')->andReturn('table.id'); $relation->getQuery()->shouldReceive('select')->once()->with('table.id')->andReturn($relation->getQuery()); $relation->getQuery()->shouldReceive('pluck')->once()->with('id')->andReturn([1, 2, 3]); $relation->getRelated()->shouldReceive('newQuery')->once()->andReturn($query = m::mock('StdClass')); $query->shouldReceive('whereIn')->once()->with('id', [1, 2, 3])->andReturn($query); - $query->shouldReceive('update')->once()->with(['updated_at' => 100]); + $query->shouldReceive('update')->once()->with(['updated_at' => '100']); $relation->touch(); }