noosfero | Validate old phone fields and check person before send notifications (!1578)

Rodrigo Souto gitlab at mg.gitlab.com
Fri Jul 27 15:52:23 BRT 2018


Rodrigo Souto started a new discussion on db/migrate/20180716142038_change_phone_fields_to_valid_format.rb:

> +class ChangePhoneFieldsToValidFormat < ActiveRecord::Migration

There are 2 problems with this migration:

1. If a person is invalid for any other reason other than the phone the migration will crash on the `person.save!`
2. You fix the invalid phones by replacing all non-numeric values but what if the number is invalid because it's too big or too smal? Those cases will crash the migration as well.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1578#note_90858772
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180727/001a4e74/attachment.html>


More information about the Noosfero-dev mailing list