Refactor normalize_for_artist_finder!

Refactors things such that Sources::Site has a normalize_for_artist_finder!
method that delegates to the strategy for the appropriate site. This way
any site that needs to normalize URLs for the artist finder can do so.
This commit is contained in:
evazion
2014-10-05 11:59:06 -05:00
parent a36472f35b
commit 7f3b98969f
4 changed files with 15 additions and 4 deletions

View File

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