[Nitro] Is there a reason I shouldn't want to do this?
george.moschovitis at gmail.com
Fri Feb 9 03:34:37 EST 2007
You should propbably be using single table inheritance. Have a look at
tc_sti.rb, tc_inheritance.rb etc for more details.
However, at the moment sti seems to be buggy (after the latest Og changes).
I will have a look at this tomorrow or something.
On 2/9/07, nyarly at gmail.com <nyarly at gmail.com> wrote:
> class Target
> attr_accessor :thing, String
> def initialize(t); thing=t; end
> class SubTarget < Target
> attr_accessor :another_thing, String
> def initialize(t, a_t); super(t); another_thing = a_t; end
> class Owner
> has_many :targets, Target
> o = Owner.new
> o.add_target(SubTarget.new("one", "two"))
> At present, this creates three tables, with a foreign key from
> og_target to og_owner, and the SubTarget gets lost because the select
> is against the og_target table.
> Is there a philosophy here that I'm not understanding?
> Nitro-general mailing list
> Nitro-general at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Nitro-general