Sha256: 96cb6b668df77410aa9ed619169bf5b39c2b4a3176965957330ff3d0ec56b30d

Contents?: true

Size: 422 Bytes

Versions: 3

Compression:

Stored size: 422 Bytes

Contents

# frozen_string_literal: true

module Rating
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)

    desc 'creates Rating migration'

    def create_migration
      template 'db/migrate/create_rating_tables.rb', "db/migrate/#{timestamp}_create_rating_tables.rb"
    end

    private

    def timestamp
      Time.current.strftime '%Y%m%d%H%M%S'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rating-0.4.0 lib/generators/rating/install_generator.rb
rating-0.3.0 lib/generators/rating/install_generator.rb
rating-0.2.0 lib/generators/rating/install_generator.rb