Permalink
Browse files

adding an initialize with name and version defaults

  • Loading branch information...
1 parent ae56c82 commit 43e2e10f4fd1111e485d4d1b1e509c00dc13c58c @tenderlove tenderlove committed Nov 17, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 activerecord/lib/active_record/migration.rb
@@ -297,8 +297,11 @@ def self.method_missing(name, *args, &block) # :nodoc:
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 @@ def write(text="")
end
def announce(message)
- version = defined?(@version) ? @version : nil
-
text = "#{version} #{name}: #{message}"
length = [0, 75 - text.length].max
write "== %s %s" % [text, "=" * length]

0 comments on commit 43e2e10

Please sign in to comment.