Sha256: d5fd46794d193ab3ef4406453cf1992add1697825d2bef5e2062fe3c4c40f805

Contents?: true

Size: 537 Bytes

Versions: 3

Compression:

Stored size: 537 Bytes

Contents

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

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

  desc "Generates a migration for the Vote 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_voteable_tables'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
make_voteable-0.1.1 lib/generators/make_voteable/make_voteable_generator.rb
make_voteable-0.1.0 lib/generators/make_voteable/make_voteable_generator.rb
make_voteable-0.0.2 lib/generators/make_voteable/make_voteable_generator.rb