1

It fits in the "schema" or document model files just fine as a

type: Money

However, any time I need the Money I get a string of a float in return. I understand it's dealing with MongoDB internally but I find my app littered with conversions of strings like BigInt.new("1.23") - BigInt.new("1.33") and surely that's not the intention.

Should I just ditch money and use BigInt in the schema? Will Mongoid support it or just save it as a string again? I was told not to use Float so I'm trying my best but my tools aren't cooperating.

dsp_099
  • 5,801
  • 17
  • 72
  • 128

1 Answers1

1

What about https://github.com/glebtv/mongoid_money_field ?
Does it fits with your needs ?

Found a talk here :
https://groups.google.com/forum/#!topic/mongoid/fTAN6VBUeT8
Last comment should confirm my proposition.

jgburet
  • 535
  • 3
  • 15