latest change should work for rails3 and not fail rails2