Commit 517da41a authored by Taylor Otwell's avatar Taylor Otwell

Tweaking has_many "save" method.

Signed-off-by: 's avatarTaylor Otwell <taylorotwell@gmail.com>
parent d0a701e8
......@@ -20,6 +20,9 @@ class Has_Many extends Has_One_Or_Many {
*/
public function save($models)
{
// If the given "models" are not an array, we'll force them into an array so
// we can conveniently loop through them and insert all of them into the
// related database table assigned to the associated model instance.
if ( ! is_array($models)) $models = array($models);
$current = $this->table->lists($this->model->key());
......
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