How to use Route class in migrations


In my application I have Route model. In migration I have to make some
operations on all routes, however simple Route.find(:all).each does not

rake aborted!
undefined method `find’ for

Well I ran on this issue back in January and found that there is some
name conflict since when I run this code in migration:

puts ActiveRecord::Base::Route.superclass
puts ActiveRecord::Base::Owner.superclass

Result is:

In January I have used dirty hack, stopping migration and running
external script. But I have to make some changes again, which require me
to update all routes. Is there some proper way to call Route.find(:all)?

Maybe I have to get used to external script or rename model from Route
to something other?

In case someone interested in details here are they:

Witold R. (EN blog) (PL blog)