Compatibility with rails4