[Nitro] HasManyCollection#each

George Moschovitis george.moschovitis at gmail.com
Sun Nov 27 05:47:03 EST 2005


> > Given:
> >
> > class A
> >  property :name, String
> >  def initialize n
> >    @name = n
> >  end
> > end
> >
> > class B
> >  property :name, String
> >  has_many :as, A
> > end
> >
> > b = B.new
> > b.add_a(A.new "a1")
> > b.add_a(A.new "a2")

Try:

b.as << A.new('a1')

btw
has_many :as
has_many A
has_many :as, A

are equivalent...

have a look at the Og test cases for the latest Og api...

-g.



--
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list