nshki / chusaku

Annotate your Rails controllers with route info.
https://rubygems.org/gems/chusaku
MIT License
87 stars 4 forks source link

Override Rails 6 annotations #11

Closed nshki closed 4 years ago

nshki commented 4 years ago

Related Issue

Closes #10.

Solution

Add a new .gsub call with a regular expression that catches scaffolded annotations. There already is a line that removes existing Chusaku annotations, so this new call was added directly after it.

Testing

I've tested this locally with a new Rails 6.0.1 app and some scaffolded controllers, but @justinshaw I'd like you to take a look at this branch as the corresponding Issue author to see if it works for the project that you're using Chusaku on.

You should be able to swap out the appropriate line in your Gemfile with:

gem 'chusaku', git: 'git://github.com/nshki/chusaku.git', branch: 'override-rails6-annotations'

Then give it another whirl with:

$ bundle exec chusaku
justinshaw commented 4 years ago

Looks good to me! Tested against the same scenario I reported originally.