You might have noticed that after switching to Rails 4 or 5, a lot of code completions and snippets stopped working. No longer can you type
bt hit tab and it expands to
belongs_to :object, :class_name => "Object", :foreign_key => "object_id".
Rails generators now create models with the ApplicationRecord base class instead of ActiveRecord::Base. TextMate needed ActiveRecord::Base to recognize the document as a Rails model. Since that's not there anymore, the snippets and shortcuts that depend on that scope aren't fired.
Fixing it take 30 seconds:
- Visit Bundle > Edit Bundles in the menu.
- Select Ruby on Rails > Language Grammars > Ruby on Rails.
- Select the editor window that appears and use Find to search for
meta.rails.model. A couple of lines below that, you'll find
ActiveRecord::Base. Change that to
- Save it, and get back to doing great work.