diff options
Diffstat (limited to 'core/controllers/welcome.php')
-rw-r--r-- | core/controllers/welcome.php | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index a3e46214..9f42c1c4 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -245,14 +245,7 @@ class Welcome_Controller extends Template_Controller { $tag_name = $tags[array_rand($tags)]; $item = $items[array_rand($items)]; - $tag = ORM::factory("tag")->where("name", $tag_name)->find(); - if (!$tag->loaded) { - $tag->name = $tag_name; - $tag->save(); - } - if (!$tag->add($item, $tag)) { - throw new Exception("@todo {$tag->name} WAS_NOT_ADDED_TO {$item->id}"); - } + tag::add_tag($item, $tag_name); } } |