Created
October 7, 2015 03:18
-
-
Save lulalala/47b71b7f6014153a0351 to your computer and use it in GitHub Desktop.
Active Model errors landmine
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
book.errors.keys | |
[:title] | |
book.errors[:base].present? | |
false | |
book.errors.keys | |
[:title, :base] | |
# and someone does this | |
if book.errors.keys.include?(:base) | |
boom!() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment