All threads / Keeping track with Annotate Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Keeping track with Annotate Discussion

7even_the_one ·

Some time ago I had issues with the `annotate` gem - specifically with auto-annotating models after a `db:migrate` and with some PostgreSQL-specific datatypes (annotate just failed on these). So I wrote an alternative - https://github.com/7even/ac..., it uses the ActiveRecord schema dumper so it can annotate everything you can see in your `db/schema.rb` in the same familiar syntax (both table fields and indexes). It doesn't annotate neither routes nor unit tests though because I didn't need those.

Thanks for sharing that! I don't think I've run annotate with Postgres specific data types so I didn't know it had trouble with that. Great job on the gem.

Reply
Fritz Rodriguez Jr. ·

FYI...I had to run "bundle exec annotate" I'm using rails 4.1.4 and ruby 2.1.2.

Reply

I've installed annotate on Rails 5,but I noticed when I run the g annotate:install that it creates a .rake file. Is it ok to use this on rails 5, because as far as I know the rake is depricated and use rails instead

Rake isn't deprecated, they just added a way for you to call it with the rails command so it's less confusing when to use rake vs rails commands. It still functions exactly the same, just simpler now. 🙌

Ah, I see, my bad.. So this works fine and in rails 5 then

Yep, shouldn't have a problem. You can always check out their GitHub if you run into issues.

Reply

Personally, I think it makes more sense to just get a GUI for your database and keep the model files clean and concise. With postgres, Postico is awesome and PSQL (a free option) is also very good.

Reply

Great content, really helpful. Here is my thought on the gem - https://www.inkoop.in/blog/how-to-use-annotate-gem/.

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,885+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.