Add comments to your tables columns - Remi Mercier

29-Jun-2024 504
I’ve been looking for a way to add default comments on models attributes for ages!By default, Rails adds comments to some attributes like id (not null, primary key for instance.)But now, I can add my own. For example, I can specify the unit for a duration column. It’s like Yard documentation for methods, but for attributes.These default comments are defined in your schema.rb, so gems like annotate will pick them up. No need to worry about overwrite anymore.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle