Fixed bug which became transparent with rails4 deprecation warning.