Skip to content

Instantly share code, notes, and snippets.

@gohuygo
Created November 1, 2012 22:31
Show Gist options
  • Select an option

  • Save gohuygo/3997136 to your computer and use it in GitHub Desktop.

Select an option

Save gohuygo/3997136 to your computer and use it in GitHub Desktop.
#strip phone number in partner_restaurant of non-numeric values
formatted_phone = SunspotHelper.sanitize_term(pr.phone).gsub(/\s+/, "")
#When iterating through each restaurant in DB,
#I want to strip all contact_phone of non-numeric values as well before checking against formatted_phone
Restaurant.where(contact_phone: formatted_phone).each do |r|
#irrelevant code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment