title: Rails 4.1 enum raises error instead set object as invalid
body: <p>I am using the Rails 4.1 enum field</p>
  
  <pre><code>class User
      enum category: [ :client, :seller, :provider ]
  end
  </code></pre>
  
  <p>When the user signs up, he chooses from a select box his category. The default is empty, because I want to force the user to choose one option.</p>
  
  <p>If the user does not select any option, I would like to return to the form with a validation message. Here is the select box code in sign up form</p>
  
  <pre><code>    &lt;%= f.select :category, [], {}, class: "form-control" do  %&gt;
          &lt;option value="99"&gt;Choose an option&lt;/option&gt;
  
          &lt;% User.categories.each do |cat,code| %&gt;
              &lt;option value="&lt;%= code %&gt;" &lt;% if params["user"] &amp;&amp; code.to_s == params["user"]["category"] %&gt;selected='selected'&lt;%end%&gt; &gt;&lt;%= t(cat) %&gt;&lt;/option&gt;
          &lt;% end %&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>When the controller creates the user, instead of adding a validation error to the record, it raises an exception. How to avoid this?</p>
  
  <pre><code>ArgumentError - '99' is not a valid category:
    (gem) activerecord-4.1.1/lib/active_record/enum.rb:103:in `block (3 levels) in enum'
    (gem) activerecord-4.1.1/lib/active_record/attribute_assignment.rb:45:in `_assign_attribute'
    (gem) activerecord-4.1.1/lib/active_record/attribute_assignment.rb:32:in `block in assign_attributes
  </code></pre>