Sha256: e671e51b383c7315e19a3626ae92ccc97c16586afcec7cb67610a2319cf188ba
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