title: Rails validation inclusion error 'not included in list'
body: <p>Hi all I have seen several issues similar to mine but none of the solutions seem to solve my issue so after a day and a half of trying everything I've decided to try my luck posting my problem.</p>
  
  <p>I have a table which in a MySQL db with this model:</p>
  
  <pre><code>class Client&lt; ActiveRecord::Base
  
    validates :name, :length =&gt; {:maximum =&gt; 255}, :presence =&gt; true
    validates :client_status, inclusion: { in: 0..2, :presence =&gt; true }
    validates :client_type, inclusion: { in: 0..2, :presence =&gt; true}
  end
  </code></pre>
  
  <p>So I want the client_status and the client_type to only be numeric values between 0 and 2, here is the rspec I wrote to accommodate this:</p>
  
  <pre><code>describe Client do
    before do
      @client = Client.new
    end
  
    it "should allow name that is less than 255 characters" do
      long_char = 'a' *254
      @client.name = long_char
      @client.client_status = 0
      @client.client_type = 1
      @client.should be_valid
    end
  
  end
  </code></pre>
  
  <p>This is a pretty simple test, I have presence true for both client_status and client_type so I must add those in the RSPEC, however running this rspec gives me this error message:</p>
  
  <pre><code>got errors: Value type is not included in the list, Status is not included in the list
  </code></pre>
  
  <p>I tried this, to see what the output is:</p>
  
  <pre><code>puts "client type is: #{@client.client_type} and status is: #{@client.client_status} ."
  </code></pre>
  
  <p>I received this output:</p>
  
  <pre><code>client type is: false and status is:  .
  </code></pre>
  
  <p>Thank you for reading this long post and I really hope someone can shed some light on this issue for me. </p>
  
  <p>Note: I have changed the names of the model/rspec and some of the fields so that I do not violate my companies NDA.</p>
  
  <p>Regards,
  Surep</p>