Modify to support app that use regacy rails(< 3.2)