Features/rails4

@noelle as discussed, my PR for rails 4 compatibility! thx a lot for reviewing! :cake: