Browse Source

Preparation of version 1.3.2

tags/1.3.2 1.3.2
Alban Jubert 7 years ago
parent
commit
f1aea75953
  1. 4
      CHANGELOG.md
  2. 5
      tests/models/UserProfile.php

4
CHANGELOG.md

@ -1,5 +1,9 @@
# Yii2 Active Record Save Relations Behavior Change Log # Yii2 Active Record Save Relations Behavior Change Log
## [1.3.2]
### Fixed
- Bug #22: Fix for HasOne relation pointing to the owner primary key (thx @mythicallage)
## [1.3.1] ## [1.3.1]
### Added ### Added
- Enh #19: Support for defining relations through the `getRelation` method (thx @execut) - Enh #19: Support for defining relations through the `getRelation` method (thx @execut)

5
tests/models/UserProfile.php

@ -18,7 +18,10 @@ class UserProfile extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
['bio', 'required'] [['user_id'], 'integer'],
['bio', 'required'],
[['user_id'], 'unique'],
[['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']]
]; ];
} }

Loading…
Cancel
Save