Modify user.rb to ensure record persistence