Adopt to Rails4.