Fix artist excerpt with wildcard searches

This commit is contained in:
Toks
2013-08-09 13:25:37 -04:00
parent a1ab9603db
commit b81804306e
2 changed files with 6 additions and 2 deletions

View File

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