[Nitro] Og newbie problems

George Moschovitis george.moschovitis at gmail.com
Thu Aug 11 12:51:35 EDT 2005

Hello Kristof,

> I kept on fighting and after some time I realized that adding any property to
> LineItem before the belongs_to declaration fixes the problem. Is there any other
> way to trigger initializing Og (I think that's what fails to happen in this
> case) than this?

you can use either:

class MyObject < Og::Entity


class MyObject # so you can still inherit from another class
  include Og::EntityMixin

as a shortcut, if you define a property, the Mixin is automatically included.

> Next I had set up an unidirectional many-to-many relationship. I tried very hard
> .. 
> think it would make sense displaying that info as well?

nice point.

> Still at the many-to-many relationship (example was many SoftwarePackage can
> contain many Software), I tried to create a constructor for SoftwarePackage
> which accepted an array of Software (simplifying the example here):
> ...
> Maybe it would be nice to have that too if possible.

A feature that will make this possible is planned for the next version
building of collections). However, if someone cares to provide an
implementation for this please feel free to submit a patch.

> As a last question, is there a way to change the oid naming strategy followed by
> Og? A similar approach as setting Og.table_prefix = nil would be really useful.

you can use either

class MyObject
  property :mykey, String, :primary_key => true

or (prefered)

class MyObject
  propety :mykey, String
  set_primary_key :mykey, String

> Thanks much, and keep up the excellent work,

Hope you will be able to help this project too :) We need all the help
we can get.



More information about the Nitro-general mailing list