if params[:status] && params[:carrier] conditions = ["actual_delivery IS NOT NULL AND actual_delivery > scheduled_delivery AND status_id = ? AND carrier_id = ?", status.id, carrier.id] elsif params[:status] ...
if @chosen_campaign.network.nil? case params[:type] when "moderated" ...
Ruby 2 Crossed conditions for Ac...
by gkochan.myopenid.com,
April 16, 2009 14:24,
-1 refactorings, tagged with activerecord, find, crossed conditions
I can't figure out any nice...
# 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
Hi!
I've a got a website A...
Need some help refactoring ...