Fix for rails 4 deprecation warnings ... fixes #150

Tests included