Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: