我不明白如何工作optional: true。它已经解决了必须存在的错误

我\xe2\x80\x99m通过rails安装了以下功能,由于验证,记录没有保存。\n我听说optional: true允许保存nil记录,但没有optional: true记录就没有保存'不过没有。当我尝试访问时发生错误relation#create。
我的代码在这里 \xe2\x86\x93
\nclass User < ApplicationRecord\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable\n devise :database_authenticatable, :registerable,\n :recoverable, :rememberable, :validatable\n \n has_many :articles\n has_many :goods\n \n has_many :active_relations, class_name: "Relation", foreign_key: :following_id\n has_many :passive_rerations, class_name: "Relation", foreign_key: :follower_id\n \n has_many :followings, through: :active_relations, source: :follower\n has_many :followers, through: :passive_rerations, source: :following\nend\nRun Code Online (Sandbox Code Playgroud)\nclass Relation < ApplicationRecord\n …Run Code Online (Sandbox Code Playgroud)