Sha256: 50ca10fb3daf259a3b5ea5dcbe91b03594b12468e239918c5c62decf88183d19

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

require 'rails/generators'

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

      source_root File.expand_path('../templates', __FILE__)

      def create_initializer_file
        copy_file 'initializer.rb', 'config/initializers/slugs.rb'
      end

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

      def self.next_migration_number(path)
        Time.now.utc.strftime '%Y%m%d%H%M%S'
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slugs-5.1.0 lib/generators/slugs/install/install_generator.rb
slugs-4.0.0.3 lib/generators/slugs/install/install_generator.rb