Sha256: 7ebaf973ae71a7adad11995b341402fa77c4e1e0dd14e24cbf26a85630d6728b

Contents?: true

Size: 538 Bytes

Versions: 6

Compression:

Stored size: 538 Bytes

Contents

require 'rails/generators'

module Gretel
  module Trail
    class MigrationGenerator < Rails::Generators::Base
      include Rails::Generators::Migration

      source_root File.expand_path('../../templates', __FILE__)
      
      def self.next_migration_number(path)
        Time.now.utc.strftime("%Y%m%d%H%M%S")
      end
      
      desc "Creates a migration for a table to store trail data"
      def create_migration
        migration_template "trail_migration.rb", "db/migrate/create_gretel_trails.rb"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gretel-trails-0.0.5 lib/generators/gretel/trail/migration_generator.rb
gretel-trails-0.0.4 lib/generators/gretel/trail/migration_generator.rb
gretel-trails-0.0.3 lib/generators/gretel/trail/migration_generator.rb
gretel-trails-0.0.2 lib/generators/gretel/trail/migration_generator.rb
gretel-3.0.0.beta4 lib/generators/gretel/trail/migration_generator.rb
gretel-3.0.0.beta3 lib/generators/gretel/trail/migration_generator.rb