Skip to content

Commit

Permalink
Fixed unique
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Aug 22, 2019
1 parent 8d021b5 commit 6fbe770
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
==============

1.0.2
---------------
* Fixed unique

1.0.1
---------------
* Updated
Expand Down
4 changes: 2 additions & 2 deletions src/YaSlugBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getValue($event)
{
if ($last = $this->owner->find()->orderBy('id DESC')->limit(1)->one())
{
$slug = $slug . '-' . $last->id;
$slug = $slug . '-' . substr(md5(microtime()), 0, 5);
return YaSlugHelper::slugify($slug);
}
}
Expand All @@ -122,7 +122,7 @@ public function getValue($event)
{
if ($last = $this->owner->find()->orderBy('id DESC')->limit(1)->one())
{
$slug = $slug . '-' . $last->id;
$slug = $slug . '-' . substr(md5(microtime()), 0, 5);
return YaSlugHelper::slugify($slug);
}
}
Expand Down

0 comments on commit 6fbe770

Please sign in to comment.