mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
convertion MigrationProxy to a Struct, initialize instance variables
This commit is contained in:
parent
341e71a1b9
commit
e6583901e5
1 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue