Commit 587a80ac authored by Kelly Banman's avatar Kelly Banman

Timestamps are optional in many-to-many pivot table

Signed-off-by: 's avatarKelly Banman <kelly.banman@gmail.com>
parent ff484b72
...@@ -25,7 +25,7 @@ class Has_Many_And_Belongs_To extends Relationship { ...@@ -25,7 +25,7 @@ class Has_Many_And_Belongs_To extends Relationship {
* *
* @var array * @var array
*/ */
protected $with = array('id', 'created_at', 'updated_at'); protected $with = array();
/** /**
* Create a new many to many relationship instance. * Create a new many to many relationship instance.
...@@ -43,6 +43,11 @@ class Has_Many_And_Belongs_To extends Relationship { ...@@ -43,6 +43,11 @@ class Has_Many_And_Belongs_To extends Relationship {
$this->joining = $table ?: $this->joining($model, $associated); $this->joining = $table ?: $this->joining($model, $associated);
if (Pivot::$timestamps)
{
$this->with = array('id', 'created_at', 'updated_at');
}
parent::__construct($model, $associated, $foreign); parent::__construct($model, $associated, $foreign);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment