Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforeXXX 插件能否在 schema 校验之前执行 #45

Closed
zgayjjf opened this issue May 14, 2019 · 2 comments
Closed

beforeXXX 插件能否在 schema 校验之前执行 #45

zgayjjf opened this issue May 14, 2019 · 2 comments

Comments

@zgayjjf
Copy link

zgayjjf commented May 14, 2019

由于现在 beforeXXX 插件是在 schema 校验之后执行的,因此如果 Schema 里面定义了一个 required 的字段,但是想在 beforeXXX 里面自动添加的话(而不是在业务代码里面手动添加,例如updated_at之类的),会报错。

因此希望可以将两者的执行顺序进行调整,而且目前来看好像没有其他影响。

@nswbmw
Copy link
Owner

nswbmw commented May 21, 2019

明白你的需求了,为啥不用 default?

@zgayjjf
Copy link
Author

zgayjjf commented May 22, 2019

直击灵魂的拷问。
之前没想到 default 可以支持函数。
那目前来看应该是没问题了。

感谢!
Issue 我关了

@zgayjjf zgayjjf closed this as completed May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants