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
1
2
3
4
def self.paged_search(query, from, category, locality, page, per_page = 10)
    query_str = []
    query_prms = []
...

Ruby Ferret, pagination and mult...

by jboss, July 17, 2008 07:34, No refactoring, tagged with rails, search, find, join, ferret, paginate

This code has multiple flaw...

3e8242329ec2756662c818a9baba76f9 Talk