Article

Improved show_model script

Posted  by Blake Watters.

PublicNot categorized.

Not tagged.

I’ve fixed some bugs and added model class whitelisting to the excellent show_model script from the thoughtbot guys. For the uninitiated, show_model is a slick little script that will show you a ton of information about the models in your Rails applications. Here’s an example run:


aria:~/near-time/near-time.net-trunk blake$ ./script/show_model ControllerPermission
ControllerPermission < Permission < ActiveRecord::Base Class Methods: controller_class_for Associations: has_many Roles DB Columns: action (string) controller_class (string) created_at (datetime) id (integer) model_class (string) tab_title (string) type (string) verb (string)

My updated version will not ‘hide’ models that are loaded by your environment and avoids some nil object errors I ran into.

This is an invaluable tool, I highly recommend adding it to all your Rails projects!

Download here (272 Bytes).


Arrow_down Hide comments

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |