title: Active Record Query - default value for find if nil value supplied
body: <p>I am searching for a user in one of my controller actions.  Sometimes, params[:user_id] will be nil, and in that case, the search should yield the current_user.  The following two search methods seem to produce the same result</p>
  
  <pre><code>@user = User.find(params[:user_id]||=current_user)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@user = User.where('id = ?', params[:user_id]).first || current_user
  </code></pre>
  
  <p>The questions are:</p>
  
  <p>1) Which search method is more appropriate, and 
  2) Is there a way to bypass the search all together if params[:user_id] is nil?</p>
  
  <p>I'm sure I could come up with a if/else statement to accomplish line 2 but that feels hackish to me.  But, maybe it's not?</p>
  
  <p>Thanks!</p>