Class: TwoFaced::Generators::InstallGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- TwoFaced::Generators::InstallGenerator
- Defined in:
- lib/generators/two_faced/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
10 11 12 |
# File 'lib/generators/two_faced/install/install_generator.rb', line 10 def self.source_root File.("../templates", __FILE__) end |
Instance Method Details
#create_migrations ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/generators/two_faced/install/install_generator.rb', line 15 def create_migrations Dir["#{self.class.source_root}/migrations/*.rb"].sort.each do |filepath| name = File.basename(filepath) migration_template "migrations/#{name}", "db/migrate/#{name.gsub(/^\d+_/,'')}" sleep 1 end end |