From 777b2da2d7615d4a0b3992631b8afde65ed796c2 Mon Sep 17 00:00:00 2001 From: Jeff Federman Date: Tue, 19 Jan 2016 21:51:49 -0500 Subject: [PATCH] Account for new Rails 5 base model and mailer classes in language definition Rails 5 introduced new base model and mailer classes, and snippets relying on those language scopes no longer worked. This commit accounts for the new classes, allowing model and mailer snippets to work properly. --- Syntaxes/Ruby on Rails.plist | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Syntaxes/Ruby on Rails.plist b/Syntaxes/Ruby on Rails.plist index 2a2f723c..5c0e6caa 100644 --- a/Syntaxes/Ruby on Rails.plist +++ b/Syntaxes/Ruby on Rails.plist @@ -80,9 +80,9 @@ begin - (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+(\s*<\s*ActionMailer::Base)))) + (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+(\s*<\s*(ActionMailer::Base|ApplicationMailer))))) comment - Uses lookahead to match classes that inherit from ActionMailer::Base; includes 'source.ruby' to avoid infinite recursion + Uses lookahead to match classes that inherit from ActionMailer::Base or ApplicationMailer; includes 'source.ruby' to avoid infinite recursion end ^\1(?=end)\b name @@ -101,9 +101,9 @@ begin - (^\s*)(?=class\s+.+ActiveRecord::Base) + (^\s*)(?=class\s+.+(ActiveRecord::Base|ApplicationRecord)) comment - Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion + Uses lookahead to match classes that (may) inherit from ActiveRecord::Base or ApplicationRecord; includes 'source.ruby' to avoid infinite recursion end ^\1(?=end)\b name