Update user.rb to fix missing ends and dos