Rails 3 version of Dealduck code