[Nitro] Og bug?

Fang Sun nusgnaf at gmail.com
Mon Feb 20 11:03:18 EST 2006


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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: notwork.rb
Type: application/octet-stream
Size: 454 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20060220/45616bc1/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: work.rb
Type: application/octet-stream
Size: 481 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20060220/45616bc1/attachment-0001.obj 


More information about the Nitro-general mailing list