upgrade for rails 4