I have a really weird error and I can't seem to fix it.
Basically I ran a rake task which updated all phone numbers on a site to themselves to take advantage of phony normalisation
i.e. they were all in different formats for few thousand records, and by applying client.update attributes(phone: client.phone) ...etc This then got them all into a consistent format.
However, it worked on everything but two records. And now I can't update any field on those records.
Completely confused... Can't update through the app Can't update through console with c.phone = X c.save Can't update through console with c.update_attributes(phone:...etc)
Anyone run into this before. Using heroku CEDAR stack with PINK pg db.
Any help much appreciated
Ok. It was a validation issue based on a bug with phony and the way it was dealing with certain types of UK numbers.
For anybody else who ends up panicking that their database has locked up some records...
client.update_attribute :phone, '44123456789'
or something similar will test whether the record will update whilst ignoring all the validation so at least you can exclude that as the problem.