lorint / brick

Auto-generate models, views, controllers, and routes in a Rails app based on database structure
Other
269 stars 8 forks source link

All Attributes in ERD? #17

Closed Jonnyghan closed 3 months ago

Jonnyghan commented 3 months ago

Trying to get all attributes in the generated ERD's, I followed the Brick.rb that was generated and tried using Brick.column_sequence = {model =>{ include: [things, and, stuff]} but I got an "undefined method" error. After looking through the repo here I'm not seeing that anywhere, is there a new method to get columns into the diagrams?

Thanks in advance!

lorint commented 3 months ago

Oh cool idea -- can make a new setting that would turn on all columns generally or for specific tables. Let me chew on this a little bit and see if an update can be quickly shipped for this.

Jonnyghan commented 3 months ago

That would be AWESOME!! Thank you for getting back to me so quickly!

lorint commented 3 months ago

Okay, the fix has shipped!

In order to refresh a project where you have installed The Brick, just run this:

gem update brick

You should note the version number of Brick and confirm that it is at least 1.0.212. And then in order to turn on full column names for all models, add this entry in your config/initializers/brick.rb file:

Brick.config.erd_show_columns = true

If you want to instead selectively enable showing all columns for just certain models, you can supply an array of model names:

Brick.config.erd_show_columns = ['User', 'OrderDetail']

Thanks for the idea, and have fun using The Brick!

Jonnyghan commented 3 months ago

Thank you! Seems like 1.0.211 is the most recent version available so I'll wait and check back probably tomorrow to see if it's updated! Really looking forward to using this!

lorint commented 3 months ago

Seems like 1.0.211 is the most recent version available

Oh silly me -- I had finished this in the early morning hours before running out the door for work, and hadn't noticed that I was using a Ruby version which is incompatible with rake release. So had just expected that it got released. Nope! Now I've just sent it out there.

Thanks so much for the feedback!