My Favorite Rails Productivity Gem: annotate_models

ruby dev.to

Very often I find myself working inside a Rails model, and I need to write a validation or a custom method. But I suddenly forget the exact name of my database column. Is it first_name or just name? Is the status an integer or a string? Usually, to find this out, you have to open your db/schema.rb file, search for the table, and read the columns. It is not too hard to do it, but when you do it 50 times a day, it gets very annoying. This is where the annotate_models (usually just called annotat

Read Full Tutorial open_in_new
arrow_back Back to Tutorials