Make work correctly in rails 3