Hello,

I have two models Host and Check connected through a join model  
CheckConfig with has_many :through relations both ways. I now have a  
third model Result, objects of which I'd like to attach to a give  
check of a given host. My idea would be to attach the Result model to  
the CheckConfig model through a belongs_to, but that brings two  
problems:
- if an object from the join model is deleted and recreated with the  
same host_id and check_id, it still gets another id, which breaks the  
belongs_to relation. Is there an option to avoid deletion of the join  
model objects and only mark them as not active or something, so that I  
can retain the simple interface of the has_many :through relationship?
- how would I have to configure the relationships to be able e.g. to  
call some_host.checks[1].results.last to get the last result for a  
give check of a given host?

I'm afraid that I won't be able to tackle that one with the standard  
built-ins, but I would be glad for any hints or help on how to best  
configure rails for that.

Thanks,

Felix

--~--~---------~--~----~------------~-------~--~----~
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