diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-03 16:32:27 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-03 16:32:27 -0700 |
commit | e6583901e58afe58aeb07f1ba1bd9f103492b98b (patch) | |
tree | b27380fc2704a2a530680e3df80983d37c6a5909 /activerecord | |
parent | 341e71a1b9a3d0ad367f79ff89b1c97fe6890905 (diff) | |
download | rails-e6583901e58afe58aeb07f1ba1bd9f103492b98b.tar.gz rails-e6583901e58afe58aeb07f1ba1bd9f103492b98b.tar.bz2 rails-e6583901e58afe58aeb07f1ba1bd9f103492b98b.zip |
convertion MigrationProxy to a Struct, initialize instance variables
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 6744a0783a..5458bba51f 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -419,9 +419,12 @@ module ActiveRecord # MigrationProxy is used to defer loading of the actual migration classes # until they are needed - class MigrationProxy + class MigrationProxy < Struct.new(:name, :version, :filename, :scope) - attr_accessor :name, :version, :filename, :scope + def initialize(name, version, filename, scope) + super + @migration = nil + end delegate :migrate, :announce, :write, :to=>:migration @@ -518,11 +521,7 @@ module ActiveRecord raise DuplicateMigrationNameError.new(name.camelize) end - migration = MigrationProxy.new - migration.name = name.camelize - migration.version = version - migration.filename = file - migration.scope = scope + migration = MigrationProxy.new(name.camelize, version, file, scope) klasses << migration end |