我目前正在使用:
money-rails v1.12 rails v6 mongoid v7
我想设置每个模型实例使用的默认货币。
我已经在我的模型中设置了字段,如下所示
field :price, type: Money, with_model_currency: :currency
但是当我尝试创建或获取记录时,我得到了这个错误
Mongoid::Errors::InvalidFieldOption
message:
Invalid option :with_model_currency provided for field :price.
如何with_model_currency
在 rails mongoid 应用程序中使用该选项?我还能如何在 rails mongoid 应用程序中处理资金?