title: Ruby: Why does 'and not' work when '&& !(expr)' does not?
body: <p>I have an if statement in my Rails app. I need to do a basic "if true and !false" sort of check. The expression is defined as:</p>
  
  <pre><code>ActiveRecord::Base.connection.tables.include? 'settings' &amp;&amp; !Settings.setting_is_set?('defaults_set')
  </code></pre>
  
  <p>If I put that as my expression to an if, the if will not trigger. If I run that expression in the console, I get false.</p>
  
  <p>Now, if I modify the expression to read:</p>
  
  <pre><code>ActiveRecord::Base.connection.tables.include? 'settings' and not Settings.setting_is_set?('defaults_set')
  </code></pre>
  
  <p>It returns true as it should, and the executes it's block.</p>
  
  <p>So the question is: Why is 'expression &amp;&amp; !expression' not behaving like 'expression and not expression'. It's my understanding &amp;&amp; and ! should correspond to and and not almost directly.</p>
  
  <p>What am I missing here?</p>