Sha256: 0c783647be264dcb811da814abd39b9b658bd98fc95b1a503d11d1544d9cee8f

Contents?: true

Size: 539 Bytes

Versions: 2

Compression:

Stored size: 539 Bytes

Contents

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

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

  desc "Generates a migration for the Flag model"

  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_make_flaggable_tables'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
make_flaggable-0.0.3 lib/generators/make_flaggable/make_flaggable_generator.rb
make_flaggable-0.0.2 lib/generators/make_flaggable/make_flaggable_generator.rb