Move normalize_for_artist_finder! into model.

Move the call to normalize_for_artist_finder! from the artist
controller into Artist#find_all_by_url. This makes testing easier.
It also makes it so that URLs are normalized when using the search
form on the artist listing page.
This commit is contained in:
evazion
2014-10-05 12:08:09 -05:00
parent 7f3b98969f
commit dcbe061809
2 changed files with 2 additions and 3 deletions

View File

@@ -118,9 +118,7 @@ class ArtistsController < ApplicationController
end
def finder
url = Sources::Site.new(params[:url]).normalize_for_artist_finder!
@artists = Artist.url_matches(url).order("id desc").limit(20)
@artists = Artist.url_matches(params[:url]).order("id desc").limit(20)
respond_with(@artists) do |format|
format.xml do
render :xml => @artists.to_xml(:include => [:urls], :root => "artists")