added additional artist test

This commit is contained in:
albert
2012-05-11 17:53:11 -04:00
parent 918664d828
commit 157789d4d5
2 changed files with 19 additions and 8 deletions

View File

@@ -20,6 +20,8 @@ class Artist < ActiveRecord::Base
search_methods :url_match, :other_names_match
module UrlMethods
extend ActiveSupport::Concern
module ClassMethods
def find_all_by_url(url)
url = ArtistUrl.normalize(url)
@@ -35,10 +37,6 @@ class Artist < ActiveRecord::Base
artists.uniq_by {|x| x.name}.slice(0, 20)
end
end
def self.included(m)
m.extend(ClassMethods)
end
def save_url_string
if @url_string
@@ -60,15 +58,13 @@ class Artist < ActiveRecord::Base
end
module NameMethods
extend ActiveSupport::Concern
module ClassMethods
def normalize_name(name)
name.to_s.downcase.strip.gsub(/ /, '_')
end
end
def self.included(m)
m.extend(ClassMethods)
end
def normalize_name
self.name = Artist.normalize_name(name)