add rails 4 support

This add Rails 4 support (optimistic) and still supports Rails 3.2.0