title: check false.present? in Ruby On Rails
body: <p>I have an API. I want to check all the blank values in the request body and reject them. Also I have few attributes which can have either true / false (boolean) as value.</p>
  <p>sample request body</p>
  <pre><code>{
    &quot;data&quot;: {
        &quot;id&quot;: 123,
         &quot;type&quot;: &quot;abc&quot;,
         &quot;attributes&quot;: {
            &quot;is_abc&quot;: false,
             &quot;name&quot;: &quot;gtd&quot;,
             &quot;is_dgc&quot;: true
           }
    }
  }    
  </code></pre>
  <p>I am validating if the request body has any blank values and raise exception if any.</p>
  <pre><code>  def validate_blank_values(params)
      blank_keys = params.map { |key, value| key if value.blank? }.compact
      raise exception
    end
  </code></pre>
  <p>value.blank? rejects even the boolean attributes when the request has false as its value which is a valid value here. Tried</p>
  <pre><code>value.present?
  </code></pre>
  <p>Also behaves the same way. The problem with .nil? is it returns false for empty string also.</p>
  <pre><code>''.nil? =&gt; false
  </code></pre>
  <p>The problem with .empty? is</p>
  <pre><code>false.empty? =&gt; (undefined method `empty?' for false:FalseClass)
  </code></pre>
  <p>I want to reject the values when they are</p>
  <ol>
  <li>blank</li>
  <li>empty string</li>
  <li>nil</li>
  </ol>
  <p>do not reject when</p>
  <ol>
  <li><p>proper value</p>
  </li>
  <li><p>false as value</p>
  </li>
  </ol>
  <p>Suggest me a solution for this</p>