has_one relation start deleting existing record even when new record failed passing validation · Issue #48330 · rails/rails
Steps to reproduce class User has_one :totp_setting end class TotpSetting belongs_to :user validates :user_id, presence: true, uniqueness: true end # in rails 7.0.4 @user.create_totp_setting! # => ...