0
0
Fork 0

issue #10 using any? is clearer

This commit is contained in:
Gibheer 2011-09-28 14:38:17 +02:00
parent 52eaaf0f6f
commit 41a470c4c0
1 changed files with 2 additions and 6 deletions

View File

@ -40,12 +40,8 @@ class Post
# checks if a post has this tag
def has_tag tag
tags.each do |t|
if t.id == tag.id
return true
end
end
false
tag_id = tag.id
tags.any? { |t| t.id == tag_id }
end
# sets all tags for this post