@@ -3,7 +3,7 require 'rails_generator/generators/components/model/model_generator' | |||
|
3 | 3 | |
|
4 | 4 | class RedminePluginModelGenerator < ModelGenerator |
|
5 | 5 | attr_accessor :plugin_path, :plugin_name, :plugin_pretty_name |
|
6 | ||
|
6 | ||
|
7 | 7 | def initialize(runtime_args, runtime_options = {}) |
|
8 | 8 | runtime_args = runtime_args.dup |
|
9 | 9 | usage if runtime_args.empty? |
@@ -12,11 +12,11 class RedminePluginModelGenerator < ModelGenerator | |||
|
12 | 12 | @plugin_path = "vendor/plugins/#{plugin_name}" |
|
13 | 13 | super(runtime_args, runtime_options) |
|
14 | 14 | end |
|
15 | ||
|
15 | ||
|
16 | 16 | def destination_root |
|
17 | 17 | File.join(Rails.root, plugin_path) |
|
18 | 18 | end |
|
19 | ||
|
19 | ||
|
20 | 20 | def manifest |
|
21 | 21 | record do |m| |
|
22 | 22 | # Check for class naming collisions. |
@@ -31,7 +31,7 class RedminePluginModelGenerator < ModelGenerator | |||
|
31 | 31 | m.template 'model.rb.erb', File.join('app/models', class_path, "#{file_name}.rb") |
|
32 | 32 | m.template 'unit_test.rb.erb', File.join('test/unit', class_path, "#{file_name}_test.rb") |
|
33 | 33 | |
|
34 |
unless options[:skip_fixture] |
|
|
34 | unless options[:skip_fixture] | |
|
35 | 35 | m.template 'fixtures.yml', File.join('test/fixtures', "#{table_name}.yml") |
|
36 | 36 | end |
|
37 | 37 |
General Comments 0
You need to be logged in to leave comments.
Login now