Sha256: 8a0e96575b3f8930e6e8aa08ebf733e7257eeb580666e926f24315f0cc3ff60e

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

require 'rails/generators'
require 'rails/generators/active_record'

module Hancock::Gallery
  class MigrationsGenerator < Rails::Generators::Base
    include ActiveRecord::Generators::Migration
    source_root File.expand_path('../templates', __FILE__)

    desc 'Hancock Gallery migration generator'
    def migration
      if Hancock.active_record?
        %w(gallery).each do |table_name|
          migration_template "migration_#{table_name}.rb", "db/migrate/hancock_gallery_create_#{table_name}.rb"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hancock_cms_gallery-1.0.2 lib/generators/hancock/gallery/migrations/migrations_generator.rb