Sha256: ac2c095011aff03d5073a797edea74b1de5554840d3f2e78bf99afbb574aac6a

Contents?: true

Size: 916 Bytes

Versions: 10

Compression:

Stored size: 916 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

10 entries across 10 versions & 1 rubygems

Version Path
wepay-rails-2.2.9 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.2.5 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.2.4 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.2.3 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.2.2 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.2.1 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.2.0 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.1.0 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-2.0.0 lib/generators/wepay_rails/install/install_generator.rb
wepay-rails-1.1.0 lib/generators/wepay_rails/install/install_generator.rb