mirror of
https://github.com/moebooru/moebooru
synced 2025-08-31 05:55:11 +00:00
r1888, r1904: "fixed artist/show" which we don't need but brings in Post.find_by_tag_join
and affects wiki and pool, too --HG-- branch : moe extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%40287
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
module PostSqlMethods
|
||||
module ClassMethods
|
||||
def find_by_tag_join(tag, options = {})
|
||||
tag = tag.downcase.tr(" ", "_")
|
||||
find(:all, :conditions => ["tags.name = ?", tag], :select => "posts.*", :joins => "JOIN posts_tags ON posts_tags.post_id = posts.id JOIN tags ON tags.id = posts_tags.tag_id", :limit => options[:limit], :offset => options[:offset], :order => (options[:order] || "posts.id DESC"))
|
||||
end
|
||||
|
||||
def generate_sql_range_helper(arr, field, c, p)
|
||||
case arr[0]
|
||||
when :eq
|
||||
|
Reference in New Issue
Block a user