Permalink
Browse files

fix taggings_by_tags to make a given tag "site-1:title" match an exis…

…ting tagging for "site-1"
  • Loading branch information...
1 parent 442333b commit 36b4f74249e06d98f243e9918e83e4c5672e4c1a Sven Fuchs committed Oct 3, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/rack/cache/tags/store/active_record.rb
@@ -22,10 +22,11 @@ def urls_by_tags(tags)
end
def taggings_by_tags(tags)
- Tagging.where((['tag LIKE ?'] * tags.size).join(' OR '), *tags.map { |tag| "#{tag}%" })
+ sql = "tag IN (?) #{[' OR tag LIKE ?'] * tags.size}"
+ Tagging.where(sql, tags, *tags.map { |tag| "#{tag.split(':').first}%" })
end
end
end
end
end
-end
+end

0 comments on commit 36b4f74

Please sign in to comment.