1
2
3
4
	# This method searches a source by  the http, the www and the trailing / to a url
	def self.find_by_url(url)
		Source.find :first, :conditions => [ " url = ? OR url = ? OR url = ? OR url = ? ", url, url.gsub("http://", "http://www"), url + "/", url.gsub("http://", "http://www")+"/"] 
...

Ruby Find a URL in a database

by julien, July 18, 2008 17:16, 3 refactorings, tagged with find, url

Hi!
I've a got a website A...

B30ce50678f0e934eaa6697425c59dd7 Talk