Roman LE NEGRATE
2006-Dec-25 17:20 UTC
TextMate command to display ActiveRecord model attributes
I''ve written a TextMate command bundle that reminds you the database columns of an ActiveRecord model displaying them in a tooltip just by selecting the model name (for example "Account") anywhere in your code and hooking up the bundle (the way you''ve chosen in the bundle properties). It''s available here: http://roman2k.free.fr/rails/tm_show_model_attributes/0.1.0/ tm_show_model_attributes.rb It''s greatly inspired from this blog entry by Chris Roos: http://blog.seagul.co.uk/articles/2006/07/14/textmate-command-to- display-active-record-column-attributes "Yeah but why should I use your version instead?" The advantages of mine over Chris''es are: - Fast load-time before displaying the tooltip. Almost instant actually: - only loads useful files and parts of the configuration (whereas the other version loads the full Rails environment), - Cleverly looks for the model file: - the model class can be nested within modules, for example: "MyBusiness::Person" - the model file is guessed to be "app/models/my_business/ person.rb", then "app/models/my_business.rb" until it''s found, - Fixes the bug that non-ActiveRecord classes aren''t recognized, - More efficient algorithm. Chris''es post explains how to install it into your TextMate, so go ahead and read it :-) However, in order to use my version of the command, use the Ruby code available at the first URL at the top of this message. I''ve tested it working but maybe not deeply enough so don''t hesitate to make a remark or issue any bug. I''d be pleased to respectively read or fix it. -Roman --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
roman2k-GANU6spQydw@public.gmane.org
2006-Dec-25 20:44 UTC
Re: TextMate command to display ActiveRecord model attributes
Oops, read " Chris'' " and not " Chris''es ". I''m sorry. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---