title: Validating inclusion in available locales
body: <p>I have a database field on my <code>Company</code> mode which specifies a company's locale. I want to validate the value of it to be contained in the available locales of <code>I18n</code>, and I found the inclusion validation of Rails to fit this task.</p>
  
  <p>But when I use</p>
  
  <pre><code>class Company &lt; ActiveRecord::Base
    validates :locale, inclusion: { in: I18n.available_locales.map { |l| l.to_s } }
  end
  </code></pre>
  
  <p><sub>(the <code>map</code> call is because <code>I18n.available_locales</code> returns an array of symbols, not strings, so we need to convert them here)</sub></p>
  
  <p>the locale <code>de</code>, which is available when I call <code>I18n.available_locales</code> from the Rails console, is <strong>not valid</strong>. What do I do?</p>