diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-17 15:30:01 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-17 15:30:09 -0800 |
commit | 43e2e10f4fd1111e485d4d1b1e509c00dc13c58c (patch) | |
tree | 2d96ee8e65d042240733dd28a2208f86859e30fc /activerecord/lib/active_record | |
parent | ae56c82e2b9f16bf754320a541bf37362661d68f (diff) | |
download | rails-43e2e10f4fd1111e485d4d1b1e509c00dc13c58c.tar.gz rails-43e2e10f4fd1111e485d4d1b1e509c00dc13c58c.tar.bz2 rails-43e2e10f4fd1111e485d4d1b1e509c00dc13c58c.zip |
adding an initialize with name and version defaults
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 65befa7473..0eabc4a4aa 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -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] |