Update for rails 3