Class: EngineRoom::Generators::CreateImageGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- EngineRoom::Generators::CreateImageGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/engine_room/create_image_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
16 17 18 |
# File 'lib/generators/engine_room/create_image_generator.rb', line 16 def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) end |
.source_root ⇒ Object
8 9 10 |
# File 'lib/generators/engine_room/create_image_generator.rb', line 8 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#copy_files ⇒ Object
20 21 22 23 |
# File 'lib/generators/engine_room/create_image_generator.rb', line 20 def copy_files migration_template "004_create_images.rb", "db/migrate/create_images.rb" copy_file "image.rb", "app/models/image.rb" end |
#doit ⇒ Object
12 13 14 |
# File 'lib/generators/engine_room/create_image_generator.rb', line 12 def doit puts "generating image model..." end |