Sha256: e439b70ab7a5d3ed0e804bf624375880c611a91ad24d57d891bbe80439cb1000

Contents?: true

Size: 940 Bytes

Versions: 4

Compression:

Stored size: 940 Bytes

Contents

require 'rails/generators/migration'

module WepayRails
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "add a migration for the Wepay Rails - WepayCheckoutRecord Model - Used to capture your transactions from Wepay"
      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

      def copy_migrations
        migration_template "create_wepay_checkout_records.rb", "db/migrate/create_wepay_checkout_records.rb"
        copy_file "wepay_checkout_record.rb", "lib/models/wepay_checkout_record.rb"
        copy_file "wepay.yml", "config/wepay.yml.example"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wepay-rails-1.0.0 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-0.2.2 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-0.2.1 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-0.2.0 lib/generators/wepay_rails/install/install_generator.rb