[#324] Rename and update the chiliproject_plugin_model generator
This commit is contained in:
parent
cdb8c68018
commit
1477e8b349
|
@ -2,4 +2,4 @@ Description:
|
||||||
Generates a plugin model.
|
Generates a plugin model.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
./script/generate redmine_plugin_model MyPlugin pool title:string question:text
|
./script/generate chiliproject_plugin_model MyPlugin pool title:string question:text
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
require 'rails_generator/base'
|
require 'rails_generator/base'
|
||||||
require 'rails_generator/generators/components/model/model_generator'
|
require 'rails_generator/generators/components/model/model_generator'
|
||||||
|
|
||||||
class RedminePluginModelGenerator < ModelGenerator
|
class ChiliprojectPluginModelGenerator < ModelGenerator
|
||||||
attr_accessor :plugin_path, :plugin_name, :plugin_pretty_name
|
attr_accessor :plugin_path, :plugin_name, :plugin_pretty_name
|
||||||
|
|
||||||
def initialize(runtime_args, runtime_options = {})
|
def initialize(runtime_args, runtime_options = {})
|
||||||
runtime_args = runtime_args.dup
|
runtime_args = runtime_args.dup
|
||||||
usage if runtime_args.empty?
|
usage if runtime_args.empty?
|
||||||
@plugin_name = "redmine_" + runtime_args.shift.underscore
|
@plugin_name = "chiliproject_" + runtime_args.shift.underscore
|
||||||
@plugin_pretty_name = plugin_name.titleize
|
@plugin_pretty_name = plugin_name.titleize
|
||||||
@plugin_path = "vendor/plugins/#{plugin_name}"
|
@plugin_path = "vendor/plugins/#{plugin_name}"
|
||||||
super(runtime_args, runtime_options)
|
super(runtime_args, runtime_options)
|
Loading…
Reference in New Issue