Sha256: eb33b67508ac730dcccb21929ccbf5129a1993daa390599ab624c0400b5a33db

Contents?: true

Size: 581 Bytes

Versions: 1

Compression:

Stored size: 581 Bytes

Contents

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

module ActsAsMessageable
  class MigrationGenerator < Rails::Generators::Base
    include Rails::Generators::Migration

    source_root File.join(File.dirname(__FILE__), 'templates')
    argument :table_name, :type => :string, :default => "messages"

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

    def create_migration_file
      migration_template 'migration.rb', 'db/migrate/create_messages_table.rb'
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-messageable-0.2.0 lib/generators/acts-as-messageable/migration/migration_generator.rb