Class: MediaInclude::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/media_include/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



20
21
22
# File 'lib/generators/media_include/install_generator.rb', line 20

def self.next_migration_number(path)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#copy_migrationObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/media_include/install_generator.rb', line 25

def copy_migration
  migration_template 'migration.rb', "db/migrate/media_include_create_media"
  template "image.rb", "app/models/image.rb"
  template "video.rb", "app/models/video.rb"
  template "_load_images.html.haml", "app/views/layouts/_load_images.html.haml"
  template "_script_template.html.erb", "app/views/layouts/_script_template.html.erb"
  template "_uploads.html.haml", "app/views/layouts/_uploads.html.haml"
  template "s3.yml", "config/s3.yml"        
  
end