title: How get integer value from a enum in Rails?
body: <p>I have a enum in my Model that corresponds to column in the database.</p>
  
  <p>The <code>enum</code> looks like:</p>
  
  <pre><code>  enum sale_info: { plan_1: 1, plan_2: 2, plan_3: 3, plan_4: 4, plan_5: 5 }
  </code></pre>
  
  <p>How can I get the integer value?</p>
  
  <p>I've tried </p>
  
  <pre><code>Model.sale_info.to_i
  </code></pre>
  
  <p>But this only returns 0.</p>