fix method usage for rails 3