class Wechat::Generators::ConfigGenerator

Public Class Methods

next_migration_number(dirname) click to toggle source
# File lib/generators/wechat/config_generator.rb, line 26
def next_migration_number(dirname)
  ::ActiveRecord::Generators::Base.next_migration_number(dirname)
end

Public Instance Methods

copy_wechat_config_migration() click to toggle source
# 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_model() click to toggle source
# File lib/generators/wechat/config_generator.rb, line 21
def copy_wechat_config_model
  template 'app/models/wechat_config.rb'
end

Private Instance Methods

migration_version() click to toggle source
# File lib/generators/wechat/config_generator.rb, line 33
def migration_version
  "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
end