Skip to content

Instantly share code, notes, and snippets.

@tsnow
Created December 16, 2010 19:54
Show Gist options
  • Save tsnow/743898 to your computer and use it in GitHub Desktop.
Save tsnow/743898 to your computer and use it in GitHub Desktop.
ruby-1.8.7-p302 > e = Ebates.first
ruby-1.8.7-p302 > first = e.current_protos.select{|i| i.rname =~ /shoe/i}[0]
"ShoeMall" "http://www.ebates.com/stores/shoemall.com.htm", cb: "8.0% "
ruby-1.8.7-p302 > dup = e.current_protos.select{|i| i.rname =~ /shoe/i}[11]
"ShoeMall" "http://www.ebates.com/stores/shoemall.com.htm", cb: "8.0% "
ruby-1.8.7-p302 > first.process
=> {:update_programs=>[], :created_ids=>[], :updated_ids=>[374513], :expired_ids=>[], :update_stores=>[]}
ruby-1.8.7-p302 > dup.process
=> {:update_programs=>[], :created_ids=>[], :updated_ids=>[374514], :expired_ids=>[], :update_stores=>[]}
Deal.find(374513) #=> NotFound since it was cycled by 'dup' and became 374514
LegacyDeal.echo(Deal.find(374514))
=> "374514, 8.0% cash back at ShoeMall from Ebates, 1962, 2010-12-16 19:39:01 UTC"
LegacyDeal.echo(ArchivedDeal.last)
"21553, 8.0% cash back at ShoeMall from Ebates, 1962, 2010-12-16 19:38:55 UTC" :new_deal_id => 374514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment