Last active
December 22, 2015 19:19
-
-
Save rlburkes/6519116 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 | |
def enumerated? | |
if defined?(super) | |
super | |
else | |
hierarchichal? | |
end | |
end | |
end | |
... | |
def up | |
ActiveRecord::Base.connection.schema_cache.clear! | |
Property.find_each do |property| | |
if property.enumerated? | |
# Do something interesting | |
else | |
# Do something less interesting | |
end | |
end | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment