Class: Wechat::Generators::ConfigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/wechat/config_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



26
27
28
# File 'lib/generators/wechat/config_generator.rb', line 26

def next_migration_number(dirname)
  ::ActiveRecord::Generators::Base.next_migration_number(dirname)
end

Instance Method Details

#copy_wechat_config_migrationObject



13
14
15
16
17
18
19
# File 'lib/generators/wechat/config_generator.rb', line 13

def copy_wechat_config_migration
  migration_template(
    'db/config_migration.rb.erb',
    'db/migrate/create_wechat_configs.rb',
    migration_version: migration_version
  )
end

#copy_wechat_config_modelObject



21
22
23
# File 'lib/generators/wechat/config_generator.rb', line 21

def copy_wechat_config_model
  template 'app/models/wechat_config.rb'
end