Created
December 29, 2011 22:21
-
-
Save rafer/1536460 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 Thing | |
include Mongoid::Document | |
field :integer_field, :type => Integer | |
field :big_decimal_field, :type => BigDecimal | |
field :date_field, :type => Date | |
end | |
thing = Thing.new | |
thing.integer_field = "WRONG" # Stores the string "WRONG" | |
thing.big_decimal_field = "WRONG" # Stores the BigDecimal equivalent of 0.0 | |
thing.date_field = "WRONG" # Throws Mongoid::Errors::InvalidTime: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment