summaryrefslogtreecommitdiffstats
path: root/lib/generators/redmine_plugin_model/templates
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generators/redmine_plugin_model/templates')
-rw-r--r--lib/generators/redmine_plugin_model/templates/fixtures.yml11
-rw-r--r--lib/generators/redmine_plugin_model/templates/migration.rb.erb13
-rw-r--r--lib/generators/redmine_plugin_model/templates/model.rb.erb2
-rw-r--r--lib/generators/redmine_plugin_model/templates/unit_test.rb.erb3
4 files changed, 2 insertions, 27 deletions
diff --git a/lib/generators/redmine_plugin_model/templates/fixtures.yml b/lib/generators/redmine_plugin_model/templates/fixtures.yml
deleted file mode 100644
index 6be3c81be..000000000
--- a/lib/generators/redmine_plugin_model/templates/fixtures.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-one:
- id: 1
-<% for attribute in attributes -%>
- <%= attribute.name %>: <%= attribute.default %>
-<% end -%>
-two:
- id: 2
-<% for attribute in attributes -%>
- <%= attribute.name %>: <%= attribute.default %>
-<% end -%>
diff --git a/lib/generators/redmine_plugin_model/templates/migration.rb.erb b/lib/generators/redmine_plugin_model/templates/migration.rb.erb
deleted file mode 100644
index 2a305a6a9..000000000
--- a/lib/generators/redmine_plugin_model/templates/migration.rb.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-class <%= migration_name %> < ActiveRecord::Migration
- def self.up
- create_table :<%= table_name %> do |t|
-<% for attribute in attributes -%>
- t.column :<%= attribute.name %>, :<%= attribute.type %>
-<% end -%>
- end
- end
-
- def self.down
- drop_table :<%= table_name %>
- end
-end
diff --git a/lib/generators/redmine_plugin_model/templates/model.rb.erb b/lib/generators/redmine_plugin_model/templates/model.rb.erb
index e730492b0..71284e96d 100644
--- a/lib/generators/redmine_plugin_model/templates/model.rb.erb
+++ b/lib/generators/redmine_plugin_model/templates/model.rb.erb
@@ -1,3 +1,3 @@
-class <%= class_name %> < ActiveRecord::Base
+class <%= @model_class %> < ActiveRecord::Base
unloadable
end
diff --git a/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb b/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb
index bc6ae913b..531510470 100644
--- a/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb
+++ b/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb
@@ -1,7 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
-class <%= class_name %>Test < ActiveSupport::TestCase
- fixtures :<%= table_name %>
+class <%= @model_class %>Test < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth