lib/rails/generators/mongoid/config/config_generator.rb in mongoid-7.1.11 vs lib/rails/generators/mongoid/config/config_generator.rb in mongoid-7.2.0.rc1

- old
+ new

@@ -13,17 +13,10 @@ def self.source_root @_mongoid_source_root ||= File.expand_path("../templates", __FILE__) end def app_name - app_cls = Rails.application.class - parent = begin - # Rails 6.1+ - app_cls.module_parent_name - rescue NoMethodError - app_cls.parent.to_s - end - parent.underscore + Rails::Application.subclasses.first.parent.to_s.underscore end def create_config_file template 'mongoid.yml', File.join('config', "mongoid.yml") end