title: rails query hstore where key IS NOT something or does not exist
body: <p>I have a table with an hstore, and sometimes i'm using it store information for a checkbox. 
  We use '1' for checked and '0' for unchecked. There is no default value for the hstore so a user can be in one of 4 states:</p>
  
  <pre><code>customer_a = Customer.new({properties: {checkbox: "1"}})   # checked
  customer_b = Customer.new({properties: nil})               # unchecked(object doesn't exist)
  customer_c = Customer.new({properties: {checkbox: "0"}})   # unchecked(unchecked)
  customer_d = Customer.new({properties: {taco: "chicken"}}) # unchecked(key doesn't exist)
  </code></pre>
  
  <p><strong>Situation:</strong> How can i find all 'unchecked' rows?</p>
  
  <pre><code>Customer.where(" customer.properties -&gt; 'checkbox' NOT LIKE '1' ")
  </code></pre>
  
  <p>^^^does not work^^^ ignores customers with empty 'checkbox' key and where properties is empty</p>
  
  <pre><code>Customer.where("customers.properties -&gt; 'checkbox' LIKE '%0%' OR customers.properties IS NULL")
  </code></pre>
  
  <p>^^^does not work^^^ also ignores where the key is missing</p>
  
  <p><em>Is there a better way to do this in a single query?</em></p>
  
  <p><strong>query should return <code>[customer_b, customer_c, customer_d]</code></strong></p>
  
  <p>current solutions:
  - checked: <code>Customer.where(" customer.properties -&gt; 'checkbox' LIKE '1' ")</code> 
  - unchecked: <code>Customer.all - Customer.where(" customer.properties -&gt; 'checkbox' LIKE '1' ")</code> </p>
  
  <p><strong>is there a sql query returning rows where an hstore key doesn't exist?</strong></p>