ack --print0 -irl 'replace_me' location/ | xargs -0 -L1 sed -i '' 's/replace_me/with_me/g'

Bash use ack and sed to find and...

by Kevin Tran, February 18, 2011 01:35, No refactoring, tagged with replace, bash, find, ack, sed

use ack and sed to find and...

D41d8cd98f00b204e9800998ecf8427e Talk
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]
...

Ruby Multiple params in find query

by Shpigford, October 29, 2010 19:03, 2 refactorings, tagged with rails, find

Need some help refactoring ...

9d4eaaf6c763c9fc01a9356ef58dbe72 Talk
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...

A0317a752d14a9ba201370824cea5815 Talk
# 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 url, find

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

B30ce50678f0e934eaa6697425c59dd7 Talk
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