Sha256: 3aa11d30c0fe67f0b86aef43a9cb0ddcf428cf543ee5e8b60301c5c2d24ae114

Contents?: true

Size: 694 Bytes

Versions: 5

Compression:

Stored size: 694 Bytes

Contents

require 'rails/generators/base'
require "rails/generators/migration"
require "rails/generators/active_record"

# Extend Rails::Generators::Base so that it creates an AR migration
module Flipper
  class ActiveRecordGenerator < Rails::Generators::Base
    include Rails::Generators::Migration
    desc "This generator creates a migration to create Flipper ActiveRecord tables."

    source_paths << File.join(File.dirname(__FILE__), "templates")

    def create_migration_file
      migration_template "migration.rb", "db/migrate/create_flipper_tables.rb"
    end

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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
flipper-activerecord-0.1.3 lib/generators/flipper/active_record_generator.rb
flipper-activerecord-0.1.2 lib/generators/flipper/active_record_generator.rb
flipper-activerecord3dot2-0.1.2 lib/generators/flipper/active_record_generator.rb
flipper-activerecord-0.1.1 lib/generators/flipper/active_record_generator.rb
flipper-activerecord-0.1.0 lib/generators/flipper/active_record_generator.rb