Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip whitespace from BatchInvitationUser email & organisation_slug #2373

Commits on Sep 25, 2023

  1. Strip whitespace from email on existing BIU records

    Trello: https://trello.com/c/aO4nVCZT
    
    I forgot to do this as part of #2371.
    
    I've constructed the query in the migration slightly differently to
    similar previous migrations, because I noticed the whitespace character
    in the regular expression wasn't working as intended.
    
    I've had to use ActiveRecord::Persistence#update_attribute in order to
    skip model validation, because some of the existing BatchInvitationUser
    records are invalid for other reasons.
    
    I did consider writing the migration as a SQL UPDATE, but generating a
    TRIM expression that is exactly equivalent to String#strip isn't as
    trivial as it sounds!
    floehopper committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    2e9d06c View commit details
    Browse the repository at this point in the history
  2. Strip whitespace from organisation_slug on existing BIU records

    Trello: https://trello.com/c/aO4nVCZT
    
    I forgot to do this as part of #2371.
    
    I've constructed the query in the migration slightly differently to
    similar previous migrations, because I noticed the whitespace character
    in the regular expression wasn't working as intended.
    
    I've had to use ActiveRecord::Persistence#update_attribute in order to
    skip model validation, because some of the existing BatchInvitationUser
    records are invalid for other reasons.
    
    I did consider writing the migration as a SQL UPDATE, but generating a
    TRIM expression that is exactly equivalent to String#strip isn't as
    trivial as it sounds!
    floehopper committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    6977102 View commit details
    Browse the repository at this point in the history