fixes #769
This commit is contained in:
@@ -42,26 +42,15 @@ module PostSets
|
|||||||
raise SearchError.new("Upgrade your account to search more than two tags at once")
|
raise SearchError.new("Upgrade your account to search more than two tags at once")
|
||||||
end
|
end
|
||||||
|
|
||||||
timeout = 3000
|
if tag_array.any? {|x| x =~ /^source:.*\*.*pixiv/} && !CurrentUser.user.is_builder?
|
||||||
|
raise SearchError.new("Your search took too long to execute and was canceled")
|
||||||
if tag_array.any? {|x| x =~ /^source:.*\*.*pixiv/}
|
|
||||||
timeout = 1000
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@posts ||= begin
|
@posts ||= begin
|
||||||
temp = ::Post.with_timeout(timeout, nil) do
|
::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page)
|
||||||
::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page)
|
|
||||||
end
|
|
||||||
|
|
||||||
if temp.nil?
|
|
||||||
raise SearchError.new("Your search took too long to execute and was canceled")
|
|
||||||
end
|
|
||||||
|
|
||||||
temp.all
|
temp.all
|
||||||
temp
|
temp
|
||||||
end
|
end
|
||||||
rescue ::Post::SearchError
|
|
||||||
@posts = ::Post.where("false")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_artist?
|
def has_artist?
|
||||||
|
|||||||
@@ -846,7 +846,6 @@ class Post < ActiveRecord::Base
|
|||||||
def to_xml(options = {}, &block)
|
def to_xml(options = {}, &block)
|
||||||
# to_xml ignores the serializable_hash method
|
# to_xml ignores the serializable_hash method
|
||||||
options ||= {}
|
options ||= {}
|
||||||
options[:methods] = [:uploader_name, :has_large]
|
|
||||||
options[:except] ||= []
|
options[:except] ||= []
|
||||||
options[:except] += hidden_attributes
|
options[:except] += hidden_attributes
|
||||||
super(options, &block)
|
super(options, &block)
|
||||||
|
|||||||
Reference in New Issue
Block a user