Rails 4 support

Add rails 4 support.