On Mar 13, 4:55 pm, Shandy Nantz <[email protected]>
wrote:
> I have two tables - Account and Enpseudo. My accounts table has an
> enpseudo_id. I am trying to do an inner join on Enpseudo and keep
> getting this error:
>
> Association named 'account' was not found; perhaps you misspelled it?
>
> I imagine this means that I have the associations in my models sut-up
> wrong.
>
> In my Account model I have: belongs_to :enpseudo
>
> In my Enpseudo model I have: has_many :accounts
>
> Here is the code to my find:
>
> @accountsfrompseudo = Enpseudo.find( :all, :joins => :account,

What you pass to :joins must exactly match the name of the association
(the first argument to has_many, belongs_to etc...).
So if you have has_many :accounts then you need :joins => :accounts or
else you will get that error message (which is normal: you don't have
an association named account only one named accounts).

Fred

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to