fixes #980
This commit is contained in:
@@ -207,12 +207,9 @@
|
||||
var $dest = $("#artist-tags");
|
||||
$dest.empty();
|
||||
|
||||
if (data.length === 0) {
|
||||
if (data.length != 1) {
|
||||
$dest.html("No artists found");
|
||||
return;
|
||||
} else if (data.length > 2) {
|
||||
$dest.html("Too many matching artists found");
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(data, function(i, json) {
|
||||
|
||||
@@ -25,7 +25,7 @@ class Artist < ActiveRecord::Base
|
||||
while artists.empty? && url.size > 10
|
||||
u = url.sub(/\/+$/, "") + "/"
|
||||
u = u.to_escaped_for_sql_like.gsub(/\*/, '%') + '%'
|
||||
artists += Artist.joins(:urls).where(["artists.is_active = TRUE AND artist_urls.normalized_url LIKE ? ESCAPE E'\\\\'", u]).all(:order => "artists.name")
|
||||
artists += Artist.joins(:urls).where(["artists.is_active = TRUE AND artist_urls.normalized_url LIKE ? ESCAPE E'\\\\'", u]).all(:order => "artists.name").limit(10)
|
||||
url = File.dirname(url) + "/"
|
||||
break if url =~ /pixiv\.net\/$/
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ Post.where("created_at > '2013-02-01'").find_each do |post|
|
||||
post.update_column(:tag_count_character, post.tag_count_character)
|
||||
end
|
||||
|
||||
PoolVersion.where("post_ids like '% 1 %'").find_each do |pool_version|
|
||||
PoolVersion.where("post_ids like '% 6 %'").find_each do |pool_version|
|
||||
cleaned_post_ids = pool_version.post_ids.scan(/(\d+) \d+/).join(" ")
|
||||
pool_version.update_column(:post_ids, cleaned_post_ids)
|
||||
end
|
||||
end; true
|
||||
|
||||
@@ -6,6 +6,6 @@ ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
||||
|
||||
ActiveRecord::Base.connection.execute("update comments set updater_id = creator_id where updater_id <> creator_id")
|
||||
|
||||
Tag.find_each do |tag|
|
||||
Tag.where("id > 519653").find_each do |tag|
|
||||
tag.fix_post_count
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user