Sha256: d9aff5442ed1abc0b9068f84473694e95ddf6af40f2c0bf8ba6560c701197873

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

module MysteriousTravellerTestGemFlex
  module Generators
    class TeamGenerator < Rails::Generators::NamedBase
      include Rails::Generators::Migration

      def self.source_root
        @source_root ||= File.join(File.dirname(__FILE__), 'templates')
      end

      def self.next_migration_number(dirname)
        if ActiveRecord::Base.timestamped_migrations
          Time.new.utc.strftime("%Y%m%d%H%M%S")
        else
          "%.3d" % (current_migration_number(dirname) + 1)
        end
      end 

      def create_migration_file
        migration_template 'migration.rb', 'db/migrate/create_team_members_table.rb'
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mysterious_traveller_test_gem_flex-0.3.1 lib/generators/mysterious_traveller_test_gem_flex/controller_generator.rb