Skip to content

Instantly share code, notes, and snippets.

@timuruski
Created August 10, 2011 21:33
Show Gist options
  • Select an option

  • Save timuruski/1138342 to your computer and use it in GitHub Desktop.

Select an option

Save timuruski/1138342 to your computer and use it in GitHub Desktop.
Why are there rats in our code?
api.themoviedb.org $ ack rats
lib/personalization/service.rb
37: rats= nil
39: rats= PersRating.find_all_by_user_id(getRatingRequest.user_id)
41: if rats && (!getRatingRequest.entity_type.nil? || !getRatingRequest.entity_id.nil?)
42: newrats= []
43: rats.each do |rat|
49: newrats <<rat
52: rats= newrats
54: if rats
70: rats= rats[offs..(offs+limit-1)]
71: if rats.nil?
72: rats= []
74: if rats
76: rats.each do |rat|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment