[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Handling Strange Superclass Mismatch

warhero

8/28/2007 3:22:00 AM

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?
--
Posted via http://www.ruby-....

1 Answer

warhero

8/28/2007 4:18:00 AM

0

I figured it out. was doing something retarded. thanks.
--
Posted via http://www.ruby-....