Rails4 compatibility

Made the gem usable with rails 4.