1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

adding an initialize with name and version defaults

This commit is contained in:
Aaron Patterson 2010-11-17 15:30:01 -08:00
parent ae56c82e2b
commit 43e2e10f4f

View file

@ -297,8 +297,11 @@ module ActiveRecord
self.delegate = new
self.verbose = true
def name
self.class.name
attr_accessor :name, :version
def initialize
@name = self.class.name
@version = nil
end
def up
@ -338,8 +341,6 @@ module ActiveRecord
end
def announce(message)
version = defined?(@version) ? @version : nil
text = "#{version} #{name}: #{message}"
length = [0, 75 - text.length].max
write "== %s %s" % [text, "=" * length]