I’m having a weird issue with Superclass Mismatches. I’m using
ActiveRecord in a project. The strange thing is that i’m getting
superclass mismatches the first time I even load a model. I’ve tried to
handle it gracefully, here is my example. this doens’t work quite
correclty. what can I do to get around this?
files = Dir.glob(MY_SERVICES + models_path)
if files.empty? then return nil end
catch(:loadfiles) do
puts "LOADING FILES"
begin
$:.unshift(MY_SERVICES)
files.each_with_index do |file,i|
rf = files.slice(i)
require rf
end
$:.shift
rescue TypeError => e
puts e.message
puts files.inspect
if e.message =~ /superclass mismatch/
throw :loadfiles
end
end
end
Why would ActiveRecord have a fit like this? I don’t alter the class
until a later point, I don’t see wy a superclass mismatch would be
happening.
any ideas?