Fixing update handling in Has_Many and Has_One relationships.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
@@ -19,6 +19,22 @@ class Has_One_Or_Many extends Relationship {
|
||||
return $this->model->create($attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a record for the association.
|
||||
*
|
||||
* @param array $attributes
|
||||
* @return bool
|
||||
*/
|
||||
public function update(array $attributes)
|
||||
{
|
||||
if ($this->model->timestamps())
|
||||
{
|
||||
$attributes['updated_at'] = $this->model->get_timestamp();
|
||||
}
|
||||
|
||||
return $this->table->update($attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the proper constraints on the relationship table.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user