Sha256: 426f3d1e439001dd9eb29cc1526061bfbf8020be3e2f3205257128d5a03f982d
Contents?: true
Size: 508 Bytes
Versions: 10
Compression:
Stored size: 508 Bytes
Contents
class AddressableRecordMigrationGenerator < Rails::Generator::NamedBase def initialize( runtime_args, runtime_options={} ) super @stamp = DateTime.now.utc.strftime( "%Y%m%d%H%M%S" ) parse_args( args ) end def manifest record do |m| m.directory "db/migrate" m.template "migration.rb", "db/migrate/#{@stamp}_#{name}.rb", :assigns => { :table => @table, :field => @field } end end private def parse_args( args ) @table = args[0] @field = args[1] end end
Version data entries
10 entries across 10 versions & 1 rubygems