From 1fb2208c5852e739bd8ac1a73211e78acb39edeb Mon Sep 17 00:00:00 2001 From: Alban Jubert Date: Fri, 10 Aug 2018 09:33:53 +0200 Subject: [PATCH] Prepare for 1.5.1 release --- CHANGELOG.md | 23 +++++++++++++++++++++++ README.md | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa54a9..7957a6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 6e151ad..53c7d6a 100644 --- a/README.md +++ b/README.md @@ -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.