@@ -7,12 +7,7 class RedminePluginGenerator < Rails::Generators::NamedBase | |||
|
7 | 7 | super |
|
8 | 8 | @plugin_name = file_name.underscore |
|
9 | 9 | @plugin_pretty_name = plugin_name.titleize |
|
10 | if Redmine::Configuration['plugins_path'].nil? | |
|
11 | @plugin_path = File.join(Rails.root, 'plugins', plugin_name) | |
|
12 | else | |
|
13 | @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) | |
|
14 | end | |
|
15 | puts @plugin_path | |
|
10 | @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) | |
|
16 | 11 | end |
|
17 | 12 | |
|
18 | 13 | def copy_templates |
@@ -9,11 +9,7 class RedminePluginControllerGenerator < Rails::Generators::NamedBase | |||
|
9 | 9 | super |
|
10 | 10 | @plugin_name = file_name.underscore |
|
11 | 11 | @plugin_pretty_name = plugin_name.titleize |
|
12 | if Redmine::Configuration['plugins_path'].nil? | |
|
13 | @plugin_path = File.join(Rails.root, 'plugins', plugin_name) | |
|
14 | else | |
|
15 | @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) | |
|
16 | end | |
|
12 | @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) | |
|
17 | 13 | @controller_class = controller.camelize |
|
18 | 14 | end |
|
19 | 15 |
@@ -14,11 +14,7 class RedminePluginModelGenerator < Rails::Generators::NamedBase | |||
|
14 | 14 | super |
|
15 | 15 | @plugin_name = file_name.underscore |
|
16 | 16 | @plugin_pretty_name = plugin_name.titleize |
|
17 | if Redmine::Configuration['plugins_path'].nil? | |
|
18 | @plugin_path = File.join(Rails.root, 'plugins', plugin_name) | |
|
19 | else | |
|
20 | @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) | |
|
21 | end | |
|
17 | @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) | |
|
22 | 18 | @model_class = model.camelize |
|
23 | 19 | @table_name = @model_class.tableize |
|
24 | 20 | @migration_filename = "create_#{@table_name}" |
General Comments 0
You need to be logged in to leave comments.
Login now