diff options
Diffstat (limited to 'railties/lib/generators/active_record/model/model_generator.rb')
-rw-r--r-- | railties/lib/generators/active_record/model/model_generator.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/railties/lib/generators/active_record/model/model_generator.rb b/railties/lib/generators/active_record/model/model_generator.rb index 448bf5c37f..45e773fde1 100644 --- a/railties/lib/generators/active_record/model/model_generator.rb +++ b/railties/lib/generators/active_record/model/model_generator.rb @@ -5,16 +5,11 @@ module ActiveRecord check_class_collision - # TODO Add parent support + conditional_class_option :timestamps + conditional_class_option :migration - # TODO Add DEFAULTS support - class_option :skip_timestamps, :type => :boolean, :default => false, - :desc => "Don't add timestamps to the migration file" - - # TODO Make this a invoke_if - # TODO Add DEFAULTS support - class_option :skip_migration, :type => :boolean, :default => false, - :desc => "Don't generate a migration file" + class_option :parent, :type => :string, :default => "ActiveRecord::Base", + :desc => "The parent class for the generated model" def create_model_file template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb") @@ -28,6 +23,7 @@ module ActiveRecord # }, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}" # end end + end end end |