Skip to content

Commit cfd01ca

Browse files
author
Jacob Bare
authored
Merge pull request #101 from zarathustra323/hotfix-0.3.16
Ensure original embeds checked in changeset
2 parents 1eb6e41 + 6e43633 commit cfd01ca

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/Models/Embeds/HasOne.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public function areDirty()
4242
return true;
4343
}
4444
}
45+
foreach ($this->getOriginalAll() as $original) {
46+
if (true === $original->isDirty()) {
47+
return true;
48+
}
49+
}
4550
return false;
4651
}
4752

@@ -51,6 +56,15 @@ public function areDirty()
5156
public function calculateChangeSet()
5257
{
5358
$set = [];
59+
foreach ($this->original as $key => $current) {
60+
if (false === $current->isDirty()) {
61+
continue;
62+
}
63+
$original = isset($this->original[$key]) ? $this->original[$key] : null;
64+
$set[$key]['old'] = $original;
65+
$set[$key]['new'] = $current;
66+
}
67+
5468
foreach ($this->current as $key => $current) {
5569
if (false === $current->isDirty()) {
5670
continue;

src/Version.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
*/
1010
class Version
1111
{
12-
const VERSION = '0.3.15';
13-
const ID = 3015;
12+
const VERSION = '0.3.16';
13+
const ID = 3016;
1414
const MAJOR = 0;
1515
const MINOR = 3;
16-
const PATCH = 15;
16+
const PATCH = 16;
1717
const EXTRA = '';
1818
}

0 commit comments

Comments
 (0)