Sha256: 5a76c9c2b3e2075dbca24c532b50b9354b4aeebe1a27888a8670ce6a06f0934d

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
make_watchable-0.0.3 lib/generators/make_watchable/make_watchable_generator.rb
make_watchable-0.0.2 lib/generators/make_watchable/make_watchable_generator.rb