我不明白如何工作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) 请帮忙指教!
路径中有一个程序:
C:\Program Files(x86)\Common Files\Autodesk Shared\AdskLicensing\Current\helper\AdskLicensingInstHelper.exe
Run Code Online (Sandbox Code Playgroud)
并且必须使用以下参数运行:
register -pk 829L1 -pv 2020.0.0.F -cf "\\ srv\deploy$\RVT20\Img\x64\RVT\RevitConfig.pit" -el EN
Run Code Online (Sandbox Code Playgroud)
我决定通过任务调度程序来完成,但是在文档中没有找到如何在添加任务后立即启动任务。
- name: recover ADSKLic Service
win_scheduled_task:
name: ADSK
description: RecADSK
actions:
- path: 'C:\Program Files(x86)\Common Files\Autodesk Shared\AdskLicensing\Current\helper\AdskLicensingInstHelper.exe'
arguments: register -pk 829L1 -pv 2020.0.0.F -cf "\\srv\deploy$\RVT20\Img\x64\RVT\RevitConfig.pit" -el EN
triggers:
- type: registration
frequency: once
state: present
enabled: yes
username: SYSTEM
tags: rev, adsk, task
Run Code Online (Sandbox Code Playgroud)
任务正在添加中,但是添加后如何立即启动呢?
win_command通过or运行 .exe 当然可能更容易,raw
但它对我不起作用......
我正在尝试构建一个工作流程,其中第一个剧本在 Windows 主机上运行,设置一些变量,其中包含正在执行的所有主机名\xe2\x80\x99s。第二个剧本应该读取这个变量并在 Unix 中使用 Windows 主机名创建一个目录。
\n尝试set_stats在第一个剧本中使用,但变量与所有主机名连接在一起,并且在 Unix 上使用大字符串创建了一个目录。
任何解决方法或建议来实现这一目标。
\nPlaybook 在 Windows 上运行
\n- name: set hostname in a variable \n set_stats: \n data: \n current_hostname: "{{ ansible_hostname }}" \n per_host: no \nRun Code Online (Sandbox Code Playgroud)\nPlaybook 在 Unix 上运行:
\n- name: Creates UNIX directory \n file: \n path: "{{ ARCH_DIR_LOC + current_hostname + \'/\'}}" \n state: directory \n mode: 0777 \nRun Code Online (Sandbox Code Playgroud)\n 我通过命令行将 bootstrap-icons 添加到我的 Laravel 8 项目中npm i bootstrap-icons
我之前已经运行过npm install并npm run dev启用 Laravel/UI。
但是当我尝试插入一个简单的图标时<i class = "bi bi-alarm"> </i>,它没有显示。
ansible ×2
windows ×2
autodesk ×1
bootstrap-4 ×1
laravel-8 ×1
ruby ×1
set ×1
statistics ×1
unix ×1