On 17 May 2010 02:20, chewmanfoo <[email protected]> wrote: > I have a hosts class with an ip_addresses class which has a host_id > attribute. All hosts are associated with a data_center, and all > ip_addresses are associated with a network. Networks have a standard > IP network definition (192.168.59.0/24) etc. When a user changes that > network definition, I need to go through all ip_addresses in the > network and change them to agree with the new network definition. For > example, if the network is defined as 192.168.59.0/24, and the user > changes it to 10.168.59.0/24 in the networks form, I need to change > all the ip_addresses in that network to match the new scheme. So I > need to know when the network changes. How do I do this? Like, is > there a way to add code to the function that sets the network > definition?
I think you have redundant data in the db, as you are storing the ip address and the network definition, where much of the data is common between these two. I suggest not storing the full ip address, just the offset from that in the network definition, or something similar. Then your problem will go away. Colin -- 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.

