I already changed the original version of the code. Before it was

    if params[:ref]
      params[:ref]
    else
      "master"
    end