tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

Recognize indented ActiveRecord models #547

Closed jeconst closed 5 years ago

jeconst commented 5 years ago

When an ActiveRecord model is nested inside a module, it isn't recognized as an ActiveRecord model (so things like :R don't jump to the schema):

module Blog
  class Post < ApplicationRecord
    self.table_name = "blog_posts"
    # ...
  end
end

This updates the patterns for two heuristics to allow leading indentation and recognize such models.

tpope commented 5 years ago

Thanks!