【问题标题】:How to annotate rails engine models with annotate_models gem?如何使用 annotate_models gem 注释 Rails 引擎模型?
【发布时间】:2015-10-15 11:17:04
【问题描述】:

我可以使用注释我的模型

annotate --exclude tests,fixtures,factories,serializers

如何在 Rails 引擎中注释模型?我尝试使用

annotate --model-dir ../your-engine-name/app/models

但是没有用。

【问题讨论】:

    标签: ruby ruby-on-rails-4 rails-engines rails-models annotate


    【解决方案1】:

    如果引擎是作为 gem 安装的,它可能不在 ../your-engine-name

    试试:

    --model-dir `bundle show your_engine_name`/app/models
    

    【讨论】:

    • 谢谢,解决了路径问题。但是,我的迁移存在于引擎内部。当我运行给定的命令时,它给出错误 Unable to annotate, cannot load a model from
    • 抱歉,不确定,我实际上并不熟悉 annotate_models gem。您可以在 annotate_models 存储库上提交问题,看看开发人员是否可以帮助您。或者尝试实际进入引擎源目录并从那里运行annotate 命令。 cd `bundle show your_engine_name`
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-25
    相关资源
    最近更新 更多