Fix artist excerpt with wildcard searches
This commit is contained in:
@@ -31,11 +31,11 @@ module PostSets
|
||||
end
|
||||
|
||||
def has_artist?
|
||||
tag_array.any? && ::Artist.name_matches(tag_string).active.exists?
|
||||
tag_array.any? && ::Artist.named(tag_string).active.exists?
|
||||
end
|
||||
|
||||
def artist
|
||||
::Artist.name_matches(tag_string).active.first
|
||||
::Artist.named(tag_string).active.first
|
||||
end
|
||||
|
||||
def pool_name
|
||||
|
||||
@@ -248,6 +248,10 @@ class Artist < ActiveRecord::Base
|
||||
where("name LIKE ? ESCAPE E'\\\\'", stripped_name)
|
||||
end
|
||||
|
||||
def named(name)
|
||||
where("name = ?", normalize_name(name))
|
||||
end
|
||||
|
||||
def any_name_matches(name)
|
||||
stripped_name = normalize_name(name).to_escaped_for_sql_like
|
||||
if name =~ /\*/ && CurrentUser.user.is_builder?
|
||||
|
||||
Reference in New Issue
Block a user