Replace Hash#compact with #reject for Rails < 4.1