diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-11-18 12:20:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-11-18 12:20:10 +0000 |
commit | 9c3e3a4276612f60552379518ab8c9a11319e73b (patch) | |
tree | abfac3dc3114e32fb583c5c3fae3661ce2431ec4 /lib/generators | |
parent | 7a9a22f3dd62ab4c1257db38f9b8c923bdcc4c8c (diff) | |
download | redmine-9c3e3a4276612f60552379518ab8c9a11319e73b.tar.gz redmine-9c3e3a4276612f60552379518ab8c9a11319e73b.zip |
Code cleanup (#24007).
git-svn-id: http://svn.redmine.org/redmine/trunk@15964 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/generators')
3 files changed, 3 insertions, 16 deletions
diff --git a/lib/generators/redmine_plugin/redmine_plugin_generator.rb b/lib/generators/redmine_plugin/redmine_plugin_generator.rb index a9d701577..ce2e2aa42 100644 --- a/lib/generators/redmine_plugin/redmine_plugin_generator.rb +++ b/lib/generators/redmine_plugin/redmine_plugin_generator.rb @@ -7,12 +7,7 @@ class RedminePluginGenerator < Rails::Generators::NamedBase super @plugin_name = file_name.underscore @plugin_pretty_name = plugin_name.titleize - if Redmine::Configuration['plugins_path'].nil? - @plugin_path = File.join(Rails.root, 'plugins', plugin_name) - else - @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) - end - puts @plugin_path + @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) end def copy_templates diff --git a/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb b/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb index 231b68810..9c42d938b 100644 --- a/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb +++ b/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb @@ -9,11 +9,7 @@ class RedminePluginControllerGenerator < Rails::Generators::NamedBase super @plugin_name = file_name.underscore @plugin_pretty_name = plugin_name.titleize - if Redmine::Configuration['plugins_path'].nil? - @plugin_path = File.join(Rails.root, 'plugins', plugin_name) - else - @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) - end + @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) @controller_class = controller.camelize end diff --git a/lib/generators/redmine_plugin_model/redmine_plugin_model_generator.rb b/lib/generators/redmine_plugin_model/redmine_plugin_model_generator.rb index bea9b6808..f26f8779c 100644 --- a/lib/generators/redmine_plugin_model/redmine_plugin_model_generator.rb +++ b/lib/generators/redmine_plugin_model/redmine_plugin_model_generator.rb @@ -14,11 +14,7 @@ class RedminePluginModelGenerator < Rails::Generators::NamedBase super @plugin_name = file_name.underscore @plugin_pretty_name = plugin_name.titleize - if Redmine::Configuration['plugins_path'].nil? - @plugin_path = File.join(Rails.root, 'plugins', plugin_name) - else - @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) - end + @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) @model_class = model.camelize @table_name = @model_class.tableize @migration_filename = "create_#{@table_name}" |