Sha256: b236e44024b5ef94c41690bc06bd0da2afc8a419e0a08ddde778b40d53ad6ca7

Contents?: true

Size: 520 Bytes

Versions: 2

Compression:

Stored size: 520 Bytes

Contents

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

class BanyanGenerator < Rails::Generators::Base
  include Rails::Generators::Migration

  desc "Generates a migration for the Banyan"

  def self.source_root
    @source_root ||= File.dirname(__FILE__) + '/templates'
  end

  def self.next_migration_number(path)
    ActiveRecord::Generators::Base.next_migration_number(path)
  end

  def generate_migration
    migration_template 'migration.rb', 'db/migrate/create_banyan_tables'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
banyan-1.1.1 lib/generators/banyan/banyan_generator.rb
banyan-1.0.1 lib/generators/banyan/banyan_generator.rb