Skip to content

Instantly share code, notes, and snippets.

@axelarge
Created February 4, 2013 23:28
Show Gist options
  • Save axelarge/4710709 to your computer and use it in GitHub Desktop.
Save axelarge/4710709 to your computer and use it in GitHub Desktop.
Weak typing = fucking fail. https://github.com/rails/rails/issues/9034
p = Product.find(546)
# Product Load (0.4ms) ...
p.price
# => #<BigDecimal:be36588,'0.0',9(18)>
p.changed
# => []
p.price = '0.0'
# => "0.0"
p.price
# => #<BigDecimal:be30a34,'0.0',9(18)>
p.changed
# => ["price"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment