fuel/orm — pull request #281 by takyam-git (2013-07-08 10:33:10+00:00)
Title: model_soft::delete() probrems

ｆｉｘ 2 probrems.

### probrem 1 : Model_Soft::delete() with belongs_field that has foreign key.
https://github.com/fuel/orm/issues/263 <- this issue.

bd7b62e

Model_Parent and Model_Child are Model_Soft.

##### save a parent with a chlid.
```php
uniqid()));
$parent->children[] = Model_Child::forge(array('name' => uniqid()));
$parent->save(true, true);
```

##### case 1: delete parent
```php
delete(true, true); //success!!
/*
mysql> select * from parents;
+----+---------------+------------+------------+------------+
| id | name | created_at | updated_at | deleted_at |
+----+---------------+------------+------------+------------+
| 1 | 51da8cb0b1852 | 1373277360 | 1373277411 | 1373277411 |
+----+---------------+------------+------------+------------+

mysql> select * from children;
+----+---------------+-----------+------------+------------+------------+
| id | name | parent_id | created_at | updated_at | deleted_at |
+----+---------------+-----------+------------+------------+------------+
| 1 | 51da8cb0b1c66 | 1 | 1373277360 | 1373277411 | 1373277411 |
+----+---------------+-----------+------------+------------+------------+
*/
```

##### case 2: delete child
```php
delete();
/*
Fuel\Core\Database_Exception [ 1048 ]: Column 'parent_id' cannot be null [ UPDATE `children` SET `deleted_at` = 1373278091, `parent_id` = null, `updated_at` = 1373278091 WHERE `id` = '1' ]
*/
```

### problem 2: Model_Soft cascade delete Model

d0f6c69

case ``Model_Parent`` extends ``\Orm\Model_Soft``, and ``Model_Child`` extends ``\Orm\Model``.

```php
delete(true, true);
/*
Orm\RelationNotSoft [ Error ]: Both sides of the relation must be subclasses of Model_Soft or Model_Temporal if cascade delete is true. Model_Child was found instead.
*/
```
-------

This pull-request fix these 2 problems, but I don't know extent of the impact.