Sha256: 78e92b7b07c9cbf6c1d2dfd75fe3d7fa1edc9e1e6a3be7667467de853ed64acd

Contents?: true

Size: 500 Bytes

Versions: 3

Compression:

Stored size: 500 Bytes

Contents

class ReportableMigrationGenerator < Rails::Generators::Base

  include Rails::Generators::Migration

  source_root File.expand_path('../templates/', __FILE__)

  def create_reportable_migration
    migration_template('migration.rb', 'db/migrate/create_reportable_cache.rb')
  end

  def self.next_migration_number(dirname)
    if ActiveRecord::Base.timestamped_migrations
      Time.now.utc.strftime("%Y%m%d%H%M%S")
    else
      "%.3d" % (current_migration_number(dirname) + 1)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reportable-1.4.2 lib/generators/reportable_migration/reportable_migration_generator.rb
reportable-1.4.1 lib/generators/reportable_migration/reportable_migration_generator.rb
reportable-1.4.0 lib/generators/reportable_migration/reportable_migration_generator.rb