Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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!
- Loading branch information