summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/generators/redmine_plugin/redmine_plugin_generator.rb7
-rw-r--r--lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb6
-rw-r--r--lib/generators/redmine_plugin_model/redmine_plugin_model_generator.rb6
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}"