Checking custom URLs and user IDs Is there a better way to do this? I'm kinda ending up having a lot of if statements.

if params[:custom_url] || params[:user_id]
    if !params[:user_id].blank?
      @user = User.find(params[:user_id]).first
      @url = @user.custom_url
    else
      @url = params[:custom_url]
      @user = User.where(:custom_url =&gt; @url).first
    end
end
Not a big fan of case..when:

@user = User.find_first(params[:user_id]) if params[:user_id]
@user ||= User.find_by_custom_url(@url)

@url = params[:custom_url] || @user.custom_url