to_hash doesn't seem to work with our setup, might be related to rails 4?