fixed index restore for rails 2.3 and rails 3.2