You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In AR 5.1 find_or_create_by and new_record_before_save? interact differently, to break the original code. (I think maybe it was relying on a bug in new_record_before_save?, I don't really understand what new_record_before_save? is).
I believe this is the same logic, rewritten more clearly and in a way that will work in Rails 5.1.
Note that find_or_create_by is NOT atomic, in any Rails version. So we should not have introduced any race condition that wasn't there already, we're still creating by soon after find if not present, just a slight intervening check for token.last == 0, shoudn't be much racier than before.
0 commit comments