Browse Source

Fix module_parent_name deprecation warning

Chris Oliver 5 years ago
parent
commit
475c87e506
1 changed files with 5 additions and 1 deletions
  1. 5 1
      template.rb

+ 5 - 1
template.rb

@@ -63,7 +63,11 @@ end
 
 def set_application_name
   # Add Application Name to Config
-  environment "config.application_name = Rails.application.class.parent_name"
+  if rails_5?
+    environment "config.application_name = Rails.application.class.parent_name"
+  else
+    environment "config.application_name = Rails.application.class.module_parent_name"
+  end
 
   # Announce the user where he can change the application name in the future.
   puts "You can change application name inside: ./config/application.rb"