[Nitro] Og and derived classes...

John Lloyd-Jones john.lloydjones at gmail.com
Fri Aug 12 11:07:58 EDT 2005


Andrew

I have been experimenting with a patch in HasMany#enchant

#    self[:foreign_key] = "#{foreign_name ||
owner_singular_name}_#{owner_pk}"  #original

    self[:foreign_key] = "#{foreign_field ||
owner_singular_name}_#{owner_pk}"  # *** hack ***

This actually fixes my problem and doesn't appear to break any of the
unit tests I have run. Alas, it has no effect on the many_to_many side
of things. For that a deeper solution is needed. I hope George gets
around to fixing it.

John


On 8/12/05, Andrew Thompson <vagabond at cataclysm-software.net> wrote:
> John,
> 
> It does indeed seem to be similar to your problem, when I do:
> 
> testclass.add_function(testmethod)
> 
> I get:
> 
> (eval):23:in `add_function': undefined method `doc_class_oid=' for
> #<DocMethod:0xb7a4bd2c> (NoMethodError)
> 
> and if I do:
> 
> puts testclass.functions
> 
> it errors out with:
> ERROR: DB error Unknown column 'doc_class_oid' in 'where clause',
> [SELECT * FROM ogdocmethod WHERE doc_class_oid = 1]
> 
> I get similar errors doing a add_function using a DocModule. but
> strangely if I do:
> 
> testmodule.save
> 
> testmethod.parent = testclass
> 
> puts testmethod.parent.inspect
> 
> It looks like its assigning testmodule as the parent, not testclass...
> 
> Very bizarre.
> 
> Oh, destroy => true was just what I needed, thanks.
> 
> Andrew
> 
> John Lloyd-Jones wrote:
> > Andrew
> >
> > Here's a couple of tips:
> >
> > use something like:
> >
> > db = Og.setup(
> >       :destroy => true,
> >       :store => 'sqlite',
> >       :name => 'andrew'
> > )
> > This re-creates your database each time. Note that I use sqlite3 --
> > it's good for this sort of work.
> >
> > What error message do you get when your test crashes? Maybe it is
> > related to the problem I reported?
> >
> > John
> >
> > _______________________________________________
> > Nitro-general mailing list
> > Nitro-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/nitro-general
> >
> >
> 
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>




More information about the Nitro-general mailing list