voormedia / rails-erd

Generate Entity-Relationship Diagrams for Rails applications
http://voormedia.github.io/rails-erd/
MIT License
3.98k stars 363 forks source link

Fix `only` option from Choice to always be an array #260

Open kerrizor opened 7 years ago

kerrizor commented 7 years ago

right now, if you pass in a single model, it errors because it casts the value as a String instead of an Array.

kerrizor commented 7 years ago

Take a look at the filter options on the Choice gem.

jimxlin commented 7 years ago

I'm having trouble replicating this error. I've run rake erd only='User' in a sample rails app and successfully created a pdf file. No problems running bundle exec erd --only='User' either.

kerrizor commented 7 years ago

This is due to the rake task and the CLI using different approaches to gathering options. The CLI uses the Choice gem, rake uses rake.

jimxlin commented 7 years ago

Please excuse my ignorance, but how would I use the CLI to create a diagram?

kerrizor commented 7 years ago
$ gem install rails-erd
$ erd

..will use the CLI version to generate the diagram. I've got an open issue to merge these so they use the same code path.

edward-ellis commented 5 years ago

Another issue with using the CLI and only is that it doesn't load the application environment, whereas with rake it does load it.