Build association silently deletes

At my last company customers sometimes complained that their profile had been deleted. It took me forever to figure out it was because they’d gone back in the signup flow and calling build again first deletes.

I totally assumed this was a serious Rails bug and opened an issue: https://github.com/rails/rails/issues/28821

But apparently it’s not a bug. It’s certainly a WTF though and it has bitten other people (see issue comments). I’d like to discuss whether the name should be changed, or a warning spat out, or a bold note in the documentation.

3 Likes