fix appearance of other tags when viewing single tag

don't just pull taggings where the tag id matches, pull all stories
where the id is in the list of stories tagged with that tag
This commit is contained in:
joshua stein 2012-07-10 13:59:45 -05:00
parent 2ba78cc10e
commit c2206f46cd

View file

@ -63,7 +63,8 @@ private
end
if tag
conds[0] << "AND taggings.tag_id = ?"
conds[0] << "AND stories.id IN (SELECT taggings.story_id FROM " <<
"taggings WHERE taggings.tag_id = ?)"
conds.push tag.id
elsif user
conds[0] += " AND taggings.tag_id NOT IN (SELECT tag_id FROM " <<