Class: USA::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- USA::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/usa/install/install_generator.rb
Overview
Everything installing this gem writes into a host: the migrations that make its tables and fill them. Not an initializer, because there is nothing here to configure.
Class Method Summary collapse
-
.source_paths ⇒ Array<String>
Where a file being copied is looked for.
Instance Method Summary collapse
-
#copy_migrations ⇒ void
Copied rather than read off the gem, so the host owns the files and their timestamps.
Class Method Details
Instance Method Details
#copy_migrations ⇒ void
This method returns an undefined value.
Copied rather than read off the gem, so the host owns the files and their timestamps.
19 20 21 22 23 |
# File 'lib/generators/usa/install/install_generator.rb', line 19 def copy_migrations Dir.children(USA::Engine.root.join('db/migrate')).sort.each do |name| migration_template name, "db/migrate/#{name.split('_', 2).last}" end end |