Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigDecimal value 0.0, converted to 1080.0 !!! #86

Open
ledowong opened this issue May 3, 2017 · 0 comments
Open

BigDecimal value 0.0, converted to 1080.0 !!! #86

ledowong opened this issue May 3, 2017 · 0 comments

Comments

@ledowong
Copy link

ledowong commented May 3, 2017

class Bar < ActiveRecord::Base
  serialize :foo
  # serialize :foo, Hash <--- add Hash not make any different
end
hash = {a: 0.0.to_d} # Decimal
bar = Bar.new
bar.foo = hash
bar.foo  #<-------- it return {":a"=>1080.0} OMG

Need to add
SafeYAML::OPTIONS[:whitelisted_tags] = ["!ruby/object:BigDecimal"]

Anyway, this year 2014 gem really useful nowadays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant