Created
February 7, 2018 16:34
-
-
Save ccyrille/61d77e74004b39d1484a90b4e7ae7f1f to your computer and use it in GitHub Desktop.
Zero Downtime - Remove a column
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 User < ActiveRecord::Base | |
... | |
# << REMOVE ON NEXT RELASE | |
def self.columns | |
super.reject { |c| c.name == "removed_column" } | |
end | |
# >> REMOVE ON NEXT RELEASE | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I am using same code and want to remove email from user. But if I do User.first.email it exist. Even User.first.attributes["email"] exist.