Wondering if anybody could give me a hand. I have three tables,
operators, operator_aps, and pingable_ips with the following
operator has_many operator_aps
operator has_many pingable_ips
Now, what I need to do is relate one of the operator’s pingable_ips
with each of their operator_aps. I’m not sure what the best way to go
about this is, or how to properly define it with the has_many/
belongs_to relationships. I was thinking of just doing:
operator_ap has_one pingable_ip
but then pingable_ip belongs_to both operator and operator_ap, and
operator_ap already belongs_to an operator. Not sure if this will
cause any issues, especially when deleting records from these tables.
If anybody has any advice on a nice way to set these relationships up,
it would be greatly appreciated.