Sha256: 310ee3d17e18f638b0b27f8a59186df9a0b04ce0f3e62fca900c51f8e0dea0bd

Contents?: true

Size: 686 Bytes

Versions: 4

Compression:

Stored size: 686 Bytes

Contents

require 'rails/generators/active_record'

module ActivityNotification
  module Generators
    # Migration generator to create migration files from templates.
    # @example Run migration generator
    #   rails generate activity_notification:migration
    class MigrationGenerator < ActiveRecord::Generators::Base
      source_root File.expand_path("../../../templates/active_record", __FILE__)

      argument :name, type: :string, default: 'CreateNotifications'

      # Create migration files in application directory
      def create_migrations
        @migration_name = name
        migration_template 'migration.rb', "db/migrate/#{name.underscore}.rb"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activity_notification-1.0.2 lib/generators/activity_notification/migration/migration_generator.rb
activity_notification-1.0.1 lib/generators/activity_notification/active_record/migration_generator.rb
activity_notification-1.0.0 lib/generators/activity_notification/active_record/migration_generator.rb
activity_notification-0.0.10 lib/generators/activity_notification/active_record/migration_generator.rb