refactorings for recurring todo model

This commit is contained in:
Reinier Balt 2012-07-13 00:31:11 +02:00
parent 80e47b94b0
commit 885ee7d1d1
3 changed files with 101 additions and 137 deletions

View file

@ -39,6 +39,10 @@ module IsTaggable
self
end
def has_tag?(tag_name)
return tags.any? {|tag| tag.name == tag_name}
end
# Add tags to <tt>self</tt>. Accepts a string of tagnames, an array of tagnames, or an array of Tags.
#
# We need to avoid name conflicts with the built-in ActiveRecord association methods, thus the underscores.