Created
June 14, 2018 14:12
-
-
Save vmcilwain/2ecaa19bd87d3fd59ff2eb052e7d0368 to your computer and use it in GitHub Desktop.
Rails 3 casting a string value into a boolean
This file contains hidden or 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
ActiveRecord::ConnectionAdapters::Column.value_to_boolean(value) | |
# Values for true: | |
# 1, "1", "t", "T", "true", "TRUE", true, "on", "ON" | |
# Values for false: | |
# 0, "0", "n", "N", "false", "FALSE", false, "off", "OFF" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment