Find your notes within your Rails app
Leaving TODOS and other notes sometimes feels like throwing trash onto a pile which you may never come back to.
You can find all notes you’ve left inside a Rails using rails notes.
This will search app, config, db, lib, and test directories for FIXME, OPTIMIZE, and TODO annotations.
Running rails notes will return something like:
app/actions/auth/creates_new_user_from_open_id_payload.rb:
* [22] [TODO] Find a way to create users linked to accounts?
* [27] [TODO] Not using these right now, and they should move to the tokens modelYou can see that we receive a list of notes including the file, line number and the note.
You can also filter for specific notes with --annotations. For example let’s filter FIXMEs:
rails notes --annotations FIXMEYou can also add custom notes in the Rails config like this:
config.annotations.register_tags("DEPRECATEME", "TESTME")Adding your own custom notes could be handy when you want to add a note for something like gem/app upgrades in code which might not be tested particularly well, or just difficult to test in general.
Tweet