add compatibility with rails 4.x - fixes deprecation warnings