I am trying to figure out a superclass mismatch TypeError exception in
one of my rails projects. Maybe someone can help here. This occurs
when I am attempting to load a file. On the first load, everything is
fine, but on subsequent loads, it gives me this exception. Here is
the pertinent code.
class Check < ActiveRecord::Base
class DRC < Check
self.name = “DRC”
self.description = “Design Rule Check”
self.global = false
Then in a controller I load this file in on a specific action.
c = check_name.constantize.new
The first time I load there are no issues. It creates a new Check
object for me and saves it into the db. Now when I delete the check
from the db and try to run through this code again I get:
superclass mismatch for class DRC
I’m not changing the superclass for DRC. I’m not reading in a
different file. I’m not sure what is going on here. Any thoughts?