ActiveRecord migration failing to save

Hi all,

I have a fairly simple migration below.
All looks good to me and throws no errors but the d/b is not getting the
new values. The final print cmd prints out the correct data. Any clues
please ?

       web_referrers = WebReferrer.find :all

       web_referrers.each do |web_referrer|
         print web_referrer.ID,"\n"
         print web_referrer.ip_addresses,"\n"

         web_referrer.ip_addresses += ','
         web_referrer.ip_addresses.sub!(/, *,/, ',')

         web_referrer.ip_addresses = tempIp
         print web_referrer.ip_addresses, "\n"!
         print "Saved ", web_referrer.ID, "\n"


I have been playing with solutions.
I should have deleted the line

         web_referrer.ip_addresses = tempIp


Bill Comer wrote:

Sussed it.
I am supporting legacy code and the primary key column is ID not id.

The cure was:

class WebReferrer < ActiveRecord::Base
      set_table_name :fred
      set_primary_key :ID