Code updates. Support for rails 4.x