News for hackers. Stuff that matters.
Re:Ruby 2.1: Profiling Ruby by Moto7451 on Tuesday December 24, 2013 @09:50PM (#6961997)
I haven't done too much Ruby myself, but the line looks sufficiently Perl like I believe the subtle change converted the first line (rolled out) from:

(excusing my Perl-Ruby mashup)

  if (params[:user_id].present){
    if (!@owner){
      @owner = User.find_by_login(params[:user_id]);
    }
  }
to:

  if (!@owner){
    if (params[:user_id].present){
      @owner = User.find_by_login(params[:user_id]);
    }
  }
Now the call params[:user_id].present is only made if @owner lacks a value.

There are no comments on this comment yet.