Wouldn't this read more easily as `if params[:q].present?`?