Re: Issue with using has_many....

Jean Nibee
Wed, 05 Sep 2007 03:59:37 -0000

Daniel ----- wrote:
>
> At a really quick glance it looks like you have a typo.
> :nhl_stat in
>
>   has_many :players, :through => :teams, :source => :nhl_stat, :order
=>
> :player_name
>
> should be
>
> :nhl_stats
>
> This is untested
> HTH
> Daniel

Getting somewhere, now when I fix typo..

>> gm = Gm.find(1)
=> #<Gm:0xb721548c
@attributes={"last_modified"=>"0000-00-00 00:00:00",
"pool_id"=>"1", "id"=>"1",
"created"=>"0000-00-00 00:00:00",
"first_name"=>"Test",
"password"=>"1234",
"last_name"=>"User",
"user_name"=>"John",
"email_address"=>"jean-J0of1frlU80@public.gmane.org"}>
>> gm.players
NameError: uninitialized constant Gm::NhlStats