Class: Fetch::Products::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Fetch::Products::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/fetch/products/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
10 11 12 |
# File 'lib/generators/fetch/products/install_generator.rb', line 10 def self.next_migration_number(path) Time.now.utc.strftime("%Y%m%d%H%M%S") end |
Instance Method Details
#create_fetch ⇒ Object
22 23 24 |
# File 'lib/generators/fetch/products/install_generator.rb', line 22 def create_fetch copy_file "product_fetch.rb", "app/models/product_fetch.rb" end |
#create_model ⇒ Object
18 19 20 |
# File 'lib/generators/fetch/products/install_generator.rb', line 18 def create_model copy_file "product.rb", "app/models/product.rb" end |
#create_table ⇒ Object
14 15 16 |
# File 'lib/generators/fetch/products/install_generator.rb', line 14 def create_table migration_template "create_products.rb", "db/migrate/create_products.rb" end |