Class: FbVideoUrlConverter::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_initializerObject



12
13
14
15
16
# File 'lib/generators/fb_video_url_converter/install_generator.rb', line 12

def add_initializer
  source = "facebook_video_converter_init.rb"
  target = "config/initializers/facebook_video_converter.rb"
  copy_file source, target
end

#add_my_migrationObject



5
6
7
8
9
10
# File 'lib/generators/fb_video_url_converter/install_generator.rb', line 5

def add_my_migration
  timestamp = Time.now.strftime("%Y%m%d%H%M%S")
  source = "create_facebook_videos_migration.rb"
  target = "db/migrate/#{timestamp}_create_facebook_videos.rb"
  copy_file source, target
end