title: How do I test if an ActiveRecord attribute is an Enum?
body: <p>How would I test if an ActiveRecord attribute is an Enum? (as per Rails 4.1 enum declaration)</p>
  
  <p>It's stored in the database and using the type method on columns_hash identifies the attribute as an integer. </p>
  
  <p>Enum definition in model</p>
  
  <pre><code>enum status: [ :in_progress, :accepted, :approved, :declined, :closed, :cancelled, :submitted ]
  </code></pre>
  
  <p>To pull the type</p>
  
  <pre><code>irb(main):030:0&gt; Application.columns_hash['status'].type
  =&gt; :integer
  </code></pre>