title: Query for records where a column is not nil in Rails 4
body: <p>In code:</p>
  
  <pre><code>&lt;% @hotelUser=HotelUser.find( cookies[:user_id2]) %&gt;
  
  &lt;%= debug @orderLast=Order.where(:email=&gt;@hotelUser.email,"order.hotel_user_id IS NOT NULL").last%&gt;
  </code></pre>
  
  <p>I am getting syntax error after executing this code.I want to search <code>hotel_user_id</code> where <code>hotel_user_id != nil or empty?</code>. Please tell me the right syntax.</p>