laravel/laravel — pull request #1084 by joecwallace (2012-08-10 03:18:02+00:00)
Title: Fixing a bug with saving data to pivot table

Right now, doing this:

```
$user = $role->users()->where_user_id($user_id)->first();
$user->pivot->status = 'A';
$user->pivot->save();
```
results in this:

```
Unhandled Exception
Message:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'connection' in 'field list'

SQL: UPDATE `user_venue` SET `connection` = ?, `updated_at` = ?, `instructor_type` = ? WHERE `id` = ?

Bindings: array (
0 => NULL,
1 => '2012-06-03 15:26:28',
2 => 'MAIN',
3 => '135',
)
```

This pull fixes that by using the Pivot class's inherited __static__ ```connection```. (Previously, assigning ``` $this->connection = $connection; ``` was causing connection to be inserted into the model's attributes by the Model class's magic method.

Does that make sense? Anyway, this fixes that.