Created
January 13, 2016 00:19
-
-
Save bronson/6dd82e44797de069ae3d to your computer and use it in GitHub Desktop.
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
class DropProperties < ActiveRecord::Migration | |
class ChangeHistory < ActiveRecord::Base | |
# copied from real ChangeHistory model | |
scope :for_target, ->(target) { where(target_type: target.class.base_class.to_s, target_id: target.id) } | |
end | |
def change | |
drop_table :properties | |
ChangeHistory.for_target('Property').destroy | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment