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:
parent
ae56c82e2b
commit
43e2e10f4f
1 changed files with 5 additions and 4 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue