Sha256: 086011ebee32a35aee2499b074c48751c2b1c80788c64690936770c4021fdc5c

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

class ReportableModelNameMigrationGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)

  include Rails::Generators::Migration

  def create_reportable_model_name_migration
    migration_template('migration.rb', 'db/migrate/reportable_rename_model_name.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_model_name_migration/reportable_model_name_migration_generator.rb
reportable-1.4.1 lib/generators/reportable_model_name_migration/reportable_model_name_migration_generator.rb
reportable-1.4.0 lib/generators/reportable_model_name_migration/reportable_model_name_migration_generator.rb