Class: Payr::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Payr::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/payr/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/generators/payr/install_generator.rb', line 8 def self.next_migration_number(dirname) if ActiveRecord::Base. Time.new.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#create_migration_file ⇒ Object
16 17 18 |
# File 'lib/generators/payr/install_generator.rb', line 16 def create_migration_file migration_template 'migration.rb', 'db/migrate/create_bills_table.rb' end |
#init ⇒ Object
20 21 22 |
# File 'lib/generators/payr/install_generator.rb', line 20 def init copy_file "payr.rb", "config/initializers/payr.rb" end |