Work in progress for Rails4 support