Class: WepayRails::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- WepayRails::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/wepay_rails/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/generators/wepay_rails/install/install_generator.rb', line 9 def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end |
Instance Method Details
#copy_migrations ⇒ Object
22 23 24 25 26 |
# File 'lib/generators/wepay_rails/install/install_generator.rb', line 22 def copy_migrations migration_template "create_wepay_checkout_records.rb", "db/migrate/create_wepay_checkout_records.rb" copy_file "wepay_checkout_record.rb", "app/models/wepay_checkout_record.rb" copy_file "wepay.yml", "config/wepay.yml.example" end |
#setup_routes ⇒ Object
18 19 20 |
# File 'lib/generators/wepay_rails/install/install_generator.rb', line 18 def setup_routes route "WepayRails.routes(self)" end |