This commit is contained in:
albert
2013-03-19 22:58:46 -07:00
parent 0495d5c338
commit 8dc6d59529
4 changed files with 5 additions and 8 deletions

View File

@@ -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