RailsBricks 3.2 has been released. It has a new really cool feature: it uses the annotate_models gem to automatically annotate your models and routes. Now, a model file, say post.rb
has the following comments at the top:
# == Schema Information
#
# Table name: posts
#
# id :integer not null, primary key
# title :string
# content_md :text
# content_html :text
# draft :boolean default(FALSE)
# user_id :integer
# slug :string
# created_at :datetime
# updated_at :datetime
It also annotates your config/routes.rb
with the result of rake routes
like this:
# == Route Map
#
# Prefix Verb URI Pattern Controller#Action
# root GET / pages#home
# home GET /home(.:format) pages#home
# inside GET /inside(.:format) pages#inside
# contact GET /contact(.:format) pages#contact
# posts GET /posts(.:format) pages#posts
# post GET /posts/:id(.:format) pages#show_post
# new_user_session GET /users/sign_in(.:format) devise/sessions#new
# ...etc
What happens when you add a model, update a model through a migration or add a new route? Well, you can re-generate updated annotations with rbricks -a
(or rbricks --annotate
if you like to type).
Hope this makes your development experience even more enjoyable 🙂