The statement set user to itself (if it is already an existing object) or User.new (which will create a new user if user is null). It's a logical OR that will avoid having an assigned null user object.
The code is a shorthand for
user = user || User.new
If user is null, then user will be set to User.new.