Add support for Rails 4.0 while maintaining Rails 3.2 backwards compat

Hi Davide, the attached patch adds support to mini_record for Rails 4.0 while also retaining Rails 3.2 backwards compat.  I've tested with two real-life Rails apps, one 3.2.12 and the other 4.0.0.  Not a very big patch but took several hours of trial and error to get working correctly. :-)

Cheers,
Nate