Rails4 compatibility

Will work only with rails4.