
Issue #19884 has been updated by AMomchilov (Alexander Momchilov). @rubyFeedback It's common in library code, that want's to be flexible to different configurations of the target application. E.g. https://github.com/rubocop/rubocop/blob/a455e9d55771f1e3dfea0cc4183e66f9632b... ---------------------------------------- Feature #19884: Make Safe Navigation Operator work on classes https://bugs.ruby-lang.org/issues/19884#change-104838 * Author: p8 (Petrik de Heus) * Status: Open * Priority: Normal ---------------------------------------- If a class might not be defined we need to add a conditional: ```ruby defined?(ActiveRecord::Base) && ActiveRecord::Base.some_method ``` It would be nice if we could use the Safe Navigation Operator instead. ```ruby ActiveRecord::Base&.some_method ``` -- https://bugs.ruby-lang.org/