Skip to content

Comment on Ruby 2.1: Profiling Rubyparent

Comments

@owner ||= User.find_by_login(params[:user_id]) if params[:user_id].present? means:

  if params[:user_id].present?
    if not @owner
      @owner = User.find_by_login(params[:user_id])
    end
  end
@owner ||= (User.find_by_login(params[:user_id]) if params[:user_id].present?) means:
  if not @owner
    if params[:user_id].present?
      @owner = User.find_by_login(params[:user_id])
    end
  end

So everytime someone called owner() to get the owner of a repo, the regex was checked
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.