Colin, You're right! But I can't go down that path right now. In the future I'll refactor the heck out of tis rats nest, but for now I have to make it work.
Jason On Mon, May 17, 2010 at 4:20 PM, Colin Law <[email protected]> wrote: > 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]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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.

