[Nitro] Og relationships

George Moschovitis george.moschovitis at gmail.com
Sun Aug 7 14:55:34 EDT 2005


This should work, I 'll look at his.

-g.

On 8/7/05, David Corbin <dcorbin at machturtle.com> wrote:
>  
> 
> I have something like this: 
> 
>  
> 
> class Foo 
> 
>  has_many :bars 
> 
>  
> 
>  def sna 
> 
>  bars << Bar.new 
> 
>  end 
> 
> end 
> 
>  
> 
> It complains that there is no bars. I've dug around, and I've not been able
> to figure out what methods the 'has_many' provides. What's the right way to
> add a Bar to a Foo in this case? 
> 
>  
> 
> Logic tells me I need to initialize an "@bars = []", (and that does make the
> immediate problems go away), but I can find no example that shows that. Does
> has_many also provide 'accessors'? 
> 
>  
> 
> David 
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
> 
> 
> 


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




More information about the Nitro-general mailing list