var_status_generator.rb 409 Bytes
require 'rails/generators'

class VarStatusGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('../templates', __FILE__)
  desc "This generator generates layout file with navigation."

  def generate_status
    d = Time.now.strftime('%Y%m%d%H%M%S')
    @model_name = name
    template "var_status.rb",
    				 "db/migrate/#{d}_add_var_status_to_#{name.pluralize.underscore}.rb"
  end
end