This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A migration that will continue to work after refactoring | |
class FutureProofMigration < ActiveRecord::Migration | |
# Redefine models used in the migration as empty inner classes. This removes all validations and magic. | |
class Model < ActiveRecord::Base; end | |
# Either don't rely on associations or declare them as referring to the new inner class | |
class DependentModel < ActiveRecord::Base | |
belongs_to :model, :class_name => "FutureProofMigration::Model" | |
end |