Posted By

vanne on 02/12/07


Tagged

rails ruby irb


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


shortcut method for display table schema


 / Published in: Ruby
 

Add this inside your .irbrc file to call "show Model" in your console instead of "y Model.column_names"

  1. #add this inside .irbrc
  2. #shortcut for y model.column_names
  3. def show(obj)
  4. y(obj.send("column_names"))
  5. end

Report this snippet  

You need to login to post a comment.