title: How to get validation constraints of ApplicationRecord model in Rails?
body: <p>I have a class that looks like:</p>
  
  <pre><code>class Account &lt; ApplicationRecord
    validates :field, presence: true,
                      inclusion:{
                        in: %w[foo bar baz bla]
                      }
  end
  </code></pre>
  
  <p>I need a method that returns the <code>inclusion</code> part of the <code>validation</code> for the <code>field</code> column. e.g.:</p>
  
  <pre><code>data = Account.validations_for(:field) # Or some similar magick method
  data[:inclusion][:in] # =&gt; ['foo', 'bar', 'baz', 'bla']
  </code></pre>
  
  <p>Does something similar exist? If it was in an <code>enum</code> it could be simple, but I can't find the way to do it in this case.</p>