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