Skip to content

Commit

Permalink
Merge pull request #101 from zarathustra323/hotfix-0.3.16
Browse files Browse the repository at this point in the history
Ensure original embeds checked in changeset
  • Loading branch information
Jacob Bare authored Oct 17, 2016
2 parents 1eb6e41 + 6e43633 commit cfd01ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions src/Models/Embeds/HasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public function areDirty()
return true;
}
}
foreach ($this->getOriginalAll() as $original) {
if (true === $original->isDirty()) {
return true;
}
}
return false;
}

Expand All @@ -51,6 +56,15 @@ public function areDirty()
public function calculateChangeSet()
{
$set = [];
foreach ($this->original as $key => $current) {
if (false === $current->isDirty()) {
continue;
}
$original = isset($this->original[$key]) ? $this->original[$key] : null;
$set[$key]['old'] = $original;
$set[$key]['new'] = $current;
}

foreach ($this->current as $key => $current) {
if (false === $current->isDirty()) {
continue;
Expand Down
6 changes: 3 additions & 3 deletions src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/
class Version
{
const VERSION = '0.3.15';
const ID = 3015;
const VERSION = '0.3.16';
const ID = 3016;
const MAJOR = 0;
const MINOR = 3;
const PATCH = 15;
const PATCH = 16;
const EXTRA = '';
}

0 comments on commit cfd01ca

Please sign in to comment.