Sha256: beb023693cd3424238842d2034e8b27ba6c2c5b343fc3e2d3e728f9588e9a9db

Contents?: true

Size: 826 Bytes

Versions: 11

Compression:

Stored size: 826 Bytes

Contents

require 'rails/generators'
require 'rails/generators/active_record'

module CryptocoinPayable
  class InstallGenerator < Rails::Generators::Base
    include Rails::Generators::Migration

    source_root File.expand_path('templates', __dir__)

    desc 'Generates (but does not run) a migration to add a coin payment tables.'

    def create_migration_file
      migration_template 'create_coin_payments.rb',
        'db/migrate/create_coin_payments.rb'

      migration_template 'create_coin_payment_transactions.rb',
        'db/migrate/create_coin_payment_transactions.rb'

      migration_template 'create_currency_conversions.rb',
        'db/migrate/create_currency_conversions.rb'
    end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cryptocoin_payable-1.4.5 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.4.4 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.4.3 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.4.2 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.4.1 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.4.0 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.3.0 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.2.0 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.1.0 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.0.1 lib/generators/cryptocoin_payable/install_generator.rb
cryptocoin_payable-1.0.0 lib/generators/cryptocoin_payable/install_generator.rb