Sha256: 5386bbf9facb78684befbb951ec05b1a9492d963067f5ffe28767b77dc900ae1

Contents?: true

Size: 810 Bytes

Versions: 25

Compression:

Stored size: 810 Bytes

Contents

class TranslationMigrationGenerator < Merb::GeneratorBase
  protected :banner

  def initialize runtime_args, runtime_options = {}
    runtime_args.push ''
    super
    @name = 'translations'
  end

  def mainfest
    record do |m|
      m.directory 'schema/migrations'
      highest_migration = Dir[Dir.pwd+'/schema/migrations/*'].map do |f|
        File.basename(f) =~ /^(\d+)/
        $1
      end.max
      filename = format '%03d_%s', (highest_migration.to_i+1), @name.snake_case
      m.template 'translation_migration.erb',
                 "schema/migrations/#{filename}.rb"
      puts banner
    end
  end

  def banner
    <<-EOS
A migration to add translation tables to your database has been created.
Run 'rake sequel:db:migrate' to add the translations migration to your database.

EOS
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
lastobelus-merb_global-0.0.10 activerecord_generators/translations_migration/translations_migration_generator.rb
lastobelus-merb_global-0.0.11 activerecord_generators/translations_migration/translations_migration_generator.rb
lastobelus-merb_global-0.0.12 activerecord_generators/translations_migration/translations_migration_generator.rb
lastobelus-merb_global-0.0.13 activerecord_generators/translations_migration/translations_migration_generator.rb
lastobelus-merb_global-0.0.14 activerecord_generators/translations_migration/translations_migration_generator.rb
lastobelus-merb_global-0.0.8 activerecord_generators/translations_migration/translations_migration_generator.rb
lastobelus-merb_global-0.0.9 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.12 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.11 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.10 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.9 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.3 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.2 activerecord_generators/translations_migration/translations_migration_generator.rb
emipair-merb_global-0.0.1 activerecord_generators/translations_migration/translations_migration_generator.rb
merb_global-0.0.2 activerecord_generators/translations_migration/translations_migration_generator.rb
merb_global-0.0.3.1 activerecord_generators/translations_migration/translations_migration_generator.rb
merb_global-0.0.5.1 activerecord_generators/translations_migration/translations_migration_generator.rb
merb_global-0.0.4 activerecord_generators/translations_migration/translations_migration_generator.rb
merb_global-0.0.4.1 activerecord_generators/translations_migration/translations_migration_generator.rb
merb_global-0.0.4.2 activerecord_generators/translations_migration/translations_migration_generator.rb