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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user