On the Project model, you're missing a :through => :timesheets on  
the :users association. My guess is that the error you're seeing is  
from Hobo trying to introspect something about that link. (For future  
reference, stack traces help! Just posting the error message without a  
trace doesn't give much info)

BTW, you should really be *testing* these associations. I'm not an  
advocate of TATFT, but even just some basic poking around in script/ 
console can help ensure that the associations work the way you want.

--Matt Jones

On Jun 18, 2009, at 12:21 PM, hobo_hippy wrote:

>
> I have three related classes, project, timesheet, and user.
>
> project.rb
> has_many :users
> has_many :timesheets
>
> timesheet.rb
> belongs_to :user, :creator => true
> belongs_to :project
>
> user.rb
> has_many :timesheets
> has_many :projects
>
> inside the project controller i added
> auto_actions_for :timesheet, :new
>
> if I understand this right, the has_many and belongs_to are setup
> correctly. However, when I run my app it throws a You have a nil
> object when you didn't expect it! The error occurred while evaluating
> nil.macro. I understand other people have had this issue, but I don't
> really understand the explanation. Is it that since i have more than
> just one simple has_many belongs_to relationship among the three that
> the relations get confused and the app doesn't know for which I want
> the new auto_action done for? If this can be fixed with manual routes,
> can someone please add a link to how routing works/examples for
> routing becuase I have zero experience with that and barely know where
> to start.
>
> Salutations,
> hobo_hippy
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to