[Nitro] Og bug?

Rob Pitt rob at motionpath.com
Mon Feb 20 11:17:29 EST 2006

Add a property to WhatINeed (or it might work if you declare the class

class WhatINeed < Og::Entity

This is a known issue and those are the easy work arounds (I usually

class WhatINeed
  is Timestamped

Which adds some properties it and causes the class to become enchanted.

On Mon, 2006-02-20 at 16:03 +0000, Fang Sun wrote:
> Hello, devs.
> I play with Og a little recently. I find that 'has_many' and
> 'belongs_to' relation doesn't work with dirctly defined class. For
> example see attached notwork.rb. It returns "notwork.rb:18: undefined
> method `belongs_to' for UserComment:Class (NoMethodError)"
> However, if I make a new class define the new table, and subclass it
> and define belongs_to there as following:
> ----------------------
> class A
> property ...
> has_many WhatINeed
> end
> class B
> property a, String
> end
> class WhatINeed < B
> belongs_to A
> end
> -----------------
> then everything works.
> Please see attatched work.rb for the working code
> Is it a bug?
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

More information about the Nitro-general mailing list