thegreatape/literate-minuteman — pull request #1 by semanticart (2012-08-20 00:55:28+00:00)
Title: Oh hai, i simplified some code for you!

Oh, hello friend. I was trolling your code for something to be pedantic about - MISSION ACCOMPLISHED!

Unless I've missed something fun you're using the Enumerable check for, this should work nicely. `Array(locations)` will make return locations as an Array if it isn't or return it unmodified if it already is an array. For more fun, we can remove the mapping of ids because Rails will do this for us for free if we let it do the interpolation (using the question mark).

As a bonus, I deleted the per_page setting just because I could. I don't think it was important, but those are often famous last words. Tests pass, ship it!

Please also find attached a three dollar bill which was given to me by a drunken Sasquatch near the BU bridge.

For added giggles, you can check out this commit which really takes the whole thing to an absurd place, proving that just because you can DRY something up doesn't always mean you should... https://github.com/semanticart/literate-minuteman/commit/e43fab858631eddca91469e14f4f891f73e57209 (it also requires removing the default scope to work... remind me to give you my default scope rant sometime)

I hope this finds you well. I cannot promise the Sasquatch will not come for his money. Please feel free to reverse-troll my hobby code :)