Sha256: 624a5555b6a53dd99eba030eb154f2f5bfe0a1fa9707c64d676fea04c01f9723

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require 'rails/generators/active_record'

module SimpleAdmin
  module Generators
    class MigrationGenerator < ActiveRecord::Generators::Base
      source_root File.expand_path('../../templates', __FILE__)

      argument :name, default: 'simple_admin'

      def copy_simple_admin_migration
        migration_template 'migrations/core_migrations/entities_migration.rb', 'db/migrate/create_simple_admin_entities.rb'

        migration_template 'migrations/core_migrations/entity_fields_migration.rb',
                           'db/migrate/create_simple_admin_entity_fields.rb'
        migration_template 'migrations/core_migrations/entity_field_types_migration.rb',
                           'db/migrate/create_simple_admin_entity_field_types.rb'
        migration_template 'migrations/core_migrations/entity_field_settings_migration.rb',
                           'db/migrate/create_simple_admin_entity_field_settings.rb'

        migration_template 'migrations/core_data_migration.rb', 'db/migrate/create_simple_admin_core_data_migration.rb'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
simple-admin-0.2.0.pre.alpha lib/generators/simple_admin/migration_generator.rb
simple-admin-0.1.2.pre.alpha lib/generators/simple_admin/migration_generator.rb
simple-admin-0.1.1.pre.alpha lib/generators/simple_admin/migration_generator.rb
simple-admin-0.1.0.pre.alpha lib/generators/simple_admin/migration_generator.rb