Found it out. type method is deprecated so it should be safe to remove.
in environments.rb
class Object
undef_method :type
end
in modelname.rb
class Modelname < ActiveRecord::base
set_inheritance_column "nothing"
end
On 11/1/06, Jon Gretar Borgthorsson
<jon.borgthorsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi There...
>
> I''m in a bit of a pickle. The thing is that I''m writing
an
> administrative rails application to handle the mysql data for a
> application(PowerDNS to be exact.) However. The problem is that I 2
> tables in there have the column "type" wich of course is a magic
> column for single table inheritance.
> I can set in my model the line
> self.inheritance_column = "nothing"
> and the script runs. However then of course I start getting ModelName
> reportend when I try using model.type to get to the type column in the
> data. Either I have to change the behaviour of .type or map .r_type to
> the "type" column. I''m unsure which is the best way to
go and how to
> do it.
>
> --
> --------------
> Jon Gretar Borgthorsson
> http://www.jongretar.net/
>
--
--------------
Jon Gretar Borgthorsson
http://www.jongretar.net/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---