0

I can annotate my models using

annotate --exclude tests,fixtures,factories,serializers

How can I annotate models inside my rails engine? I tried using

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

but it didn't work.

Simmi Badhan
  • 493
  • 1
  • 5
  • 16

1 Answers1

1

The engine, if it's installed as a gem, probably isn't located at ../your-engine-name

Try:

--model-dir `bundle show your_engine_name`/app/models
jrochkind
  • 22,799
  • 12
  • 59
  • 74
  • Thanks, that solved the path issue. However, my migrations are present inside the engine. When I run the given command, it gives error Unable to annotate, cannot load a model from – Simmi Badhan Oct 15 '15 at 12:59
  • Sorry, not sure, I'm not actually familiar with the annotate_models gem. You might file an Issue on the annotate_models repo and see if the developers can help you. Or try actually going into the engine source directory and running the `annotate` command from there. `cd \`bundle show your_engine_name\`` – jrochkind Oct 15 '15 at 13:01