aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/generators/rails')
-rw-r--r--railties/lib/generators/rails/model/USAGE3
-rw-r--r--railties/lib/generators/rails/model_subclass/model_subclass_generator.rb11
2 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/model/USAGE b/railties/lib/generators/rails/model/USAGE
index 73c8b69153..b056d5df8b 100644
--- a/railties/lib/generators/rails/model/USAGE
+++ b/railties/lib/generators/rails/model/USAGE
@@ -12,6 +12,9 @@ Description:
This generator invokes your configured ORM and test framework, which
defaults to ActiveRecord and TestUnit.
+ Finally, if --parent option is given, it's used as superclass of the
+ created model. This allows you create Single Table Inheritance models.
+
Examples:
`./script/generate model account`
diff --git a/railties/lib/generators/rails/model_subclass/model_subclass_generator.rb b/railties/lib/generators/rails/model_subclass/model_subclass_generator.rb
new file mode 100644
index 0000000000..4649709780
--- /dev/null
+++ b/railties/lib/generators/rails/model_subclass/model_subclass_generator.rb
@@ -0,0 +1,11 @@
+module Rails
+ module Generators
+ class ModelSubclassGenerator < Base
+ desc "model_subclass is deprecated. Invoke model with --parent option instead."
+
+ def say_deprecation_warn
+ say self.class.desc
+ end
+ end
+ end
+end