From cebdf7c4db6caf902d1374e0e55ffde9a30083fb Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Fri, 7 Sep 2007 22:35:33 +0000 Subject: [PATCH] ActionItem4: redirected the keywords of articles of comatose to the acts_as_taggable plugin --- app/models/article.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/models/article.rb b/app/models/article.rb index a7eefb8..9561876 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -1,4 +1,15 @@ class Article < Comatose::Page -end -class Article < Comatose::Page + acts_as_taggable + + def keywords + tag_list.to_s + end + + def keywords=(list_tag) + self.tag_list = list_tag + end + + def has_keyword?(keyword) + tags.map{|t| t.name.downcase}.include?(keyword.downcase) + end end -- libgit2 0.21.2