Last active
December 22, 2015 19:19
-
-
Save rlburkes/6519103 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 BuildPropertyAssociationsOnExports < ActiveRecord::Migration | |
... | |
class Property < ActiveRecord::Base | |
attr_accessible :hierarchical | |
end | |
... | |
def up | |
ActiveRecord::Base.connection.schema_cache.clear! | |
Property.find_each do |property| | |
if property.hierarchical? | |
# Do something interesting | |
else | |
# Do something less interesting | |
end | |
end | |
end | |
def down | |
# undo some interesting things | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment