title: Rails single table inheritance ActiveRecord::SubclassNotFound
body: <p>I tried changing a User type to "nil" and keep getting this error message now:</p>
  
  <blockquote>
    <p>The single-table inheritance mechanism failed to locate the subclass: 'nil'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite User.inheritance_column to use another column for that information.</p>
  </blockquote>
  
  <pre><code>from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/inheritance.rb:161:in `rescue in find_sti_class'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/inheritance.rb:155:in `find_sti_class'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/inheritance.rb:144:in `discriminate_class_for_record'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/persistence.rb:50:in `instantiate'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/querying.rb:48:in `block in find_by_sql'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/result.rb:55:in `block in each'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/result.rb:55:in `each'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/result.rb:55:in `each'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/querying.rb:48:in `map'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/querying.rb:48:in `find_by_sql'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/relation.rb:603:in `exec_queries'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/relation.rb:487:in `load'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/relation.rb:231:in `to_a'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/bullet-4.13.1/lib/bullet/active_record41.rb:10:in `to_a'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/relation/finder_methods.rb:479:in `find_last'
  from /usr/local/rvm/gems/ruby-2.0.0-p481@rails-4.0.2/gems/activerecord-4.1.1/lib/active_record/relation/finder_methods.rb:165:in `last'
  </code></pre>
  
  <p>I understand why it's happening and I do want the single table inheritance to occur but it won't even let me override it Rails Console. I'm trying to change the User type back to what I need and it immediately gives me that message. Even if I do User.find(<em>myID</em>) it won't pull up my data. </p>
  
  <p>Any way I can just tell it to override it and change the type?</p>
  
  <p>Edit:</p>
  
  <p>I tried:</p>
  
  <pre><code>User.last (I was the last user)
  
  User.find(*myId*)
  </code></pre>
  
  <p>It won't even let me do <code>User.last.destroy</code> or <code>User.destroy_all</code>, giving me the same error above each time in the console. </p>
  
  <p>I also tried creating a model called "nil" that inherits from User and still nothing.</p>