Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Prepare for 1.5.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Alban Jubert committed Aug 10, 2018
1 parent 93821de commit 1fb2208
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Yii2 Active Record Save Relations Behavior Change Log

## [1.5.1]
### Fixed
- Bug #33: Custom relation scenario was set too late and was preventing attributes from being correctly set (thx @phrakon)

## Added
- New method `setRelationScenario` can set a relation scenario at runtime

## Changed
- Light refactoring
- Updated documentation

## [1.5.0]
### Added
- Enh #5: Ability to automaticaly delete related records along with the main model

### Fixed
- Bug #30: HasOne relation saving issue (thx @phrakon)
- Fix for SaveRelationTrait (thx @leandrogehlen)

### Changed
- Some code refactoring
- Yii2 requirements raised to 2.0.14

## [1.4.1]
### Fixed
- Bug #24: Fix a regression introduced in 1.4.0 release where validation of hasOne relations was not triggered. (thx @dabkhazi)
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ For instance, in the following configuration, the `links ` related records will
}
...
```

It is also possible to set a relation scenario at runtime using the `setRelationScenario` as follow:

```php
$model->setRelationScenario('relationName', 'scenarioName');
```

> **Tips:**
> For relations not involving a junction table by using the `via()` or `viaTable()` methods, you should remove the attributes pointing to the owner model from the 'required' validation rules to be able to pass the validations.
Expand Down

0 comments on commit 1fb2208

Please sign in to comment.