The state of Rails plugins

Plugins are great, they help you dry up your code, add features, etc. quickly and easily. But how do you know if a plugin is going to be good, or if it’s outdated completely…..
I usually check the following sites to find out:
http://railsplugins.org/ and http://www.ruby-toolbox.com/
The latter is mostly an overview of gems categorized by what they […]

Using will_paginate in sinatra

Want some sweet pagination on your sinatra app? I know it’s a loaded question with sinatra’s methodology of keeping things slim, but here goes.
There is a framework agnostic branch of mislav-will_paginate on github. What I did was pull that into vendor/gems and added the following code to make it work.
$LOAD_PATH.unshift File.dirname(__FILE__) + ‘/vendor/gems/will_paginate/lib’ # using […]

batch finding composite primary keys [SOLVED]

Issue with composite_primary_keys and find_in_batches. In short, they don’t play nicely together.

Issue:

Rails 2.3+ find_in_batches will not work if your model has composite primary keys.

Solution:

I found this gist:

https://gist.github.com/105318/13fe7c42c95c820fadbad84d54e00680ce9d110f

which solved the issue. I just dropped it into a file in RAILS_ROOT/config/initializers to extend active record to be able to do batch finds on those models which use composite_primary_keys