lib/demo_mode/config.rb in demo_mode-1.0.3 vs lib/demo_mode/config.rb in demo_mode-1.1.0

- old
+ new

@@ -20,15 +20,11 @@ configurations << :personas configurations << :sign_up_path configurations << :sign_in_path def self.app_name - if Rails::VERSION::MAJOR >= 6 - Rails.application.class.module_parent.name - else - Rails.application.class.parent.name - end + Rails.application.class.module_parent.name end def logo(&block) if block @logo = block @@ -111,10 +107,10 @@ end private def auto_load_personas! - Dir.glob(Rails.root.join(personas_path, '**', '*.rb')).sort.each do |persona| + Rails.root.glob("#{personas_path}/**/*.rb").sort.each do |persona| raise <<~ERROR if File.readlines(persona).grep(/DemoMode\.add_persona/).empty? This file does not define a persona: #{persona}\n Please use `DemoMode.add_persona` ERROR