You can think of it as short for:
@current_user = @current_user || User.find_by_id(session[:user_id])
@current_user gets evaluated first, if it is non-null then the OR short-circuits, returning the value of @current_user, and not calling User.find_by_id.
(This works only because Ruby treats null as false, and non-null as true, in a boolean context. It doesn't work for languages like Java that don't treat non-booleans as truthy.)