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