Re: Issue with using has_many....

Daniel N
Wed, 05 Sep 2007 04:07:34 -0000

On 9/5/07, Jean Nibee
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
>
> 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
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
hmmm  not sure on this one.  Try putting in a classname in there

   has_many :players, :through => :teams, :source =>
:nhl_stats, :class_name => "NhlStat",  :order =>