gpt4 book ai didi

ruby-on-rails - ruby rails : How to check if the Model Exists

转载 作者:数据小太阳 更新时间:2023-10-29 06:45:21 25 4
gpt4 key购买 nike

我想知道如何检查模型是否已经存在于项目中?

当用户尝试使用相同的模型名称以编程方式创建模型时,需要检查它是否已经存在?

最佳答案

定义了吗?如果模型已定义,ModelName 将返回“常量”。

关于ruby-on-rails - ruby rails : How to check if the Model Exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11793869/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com