Class: EngineRoom::Generators::CreateImageGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
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_rootObject



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_filesObject



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

#doitObject



12
13
14
# File 'lib/generators/engine_room/create_image_generator.rb', line 12

def doit
  puts "generating image model..."
end