Add support to Rails 4.1

Moving the #423 to here. Because the other is to merge on branch `jd-add-4-1-beta` now this is to merge on master.

After the rebase on master 1 spec is broken. I tell you guys when this is fixed.