Closed chase-stevens closed 10 months ago
I wanted to see if we could set validations on currency columns such that we only allow certain currencies to be initialized as Money objects or saved to currency columns (for example, USD and MXN) and/or disable others (GBP, EUR).
In my apps I use something like this for this:
validates :currency, inclusion: {in: -> %w[USD MXN]}
Thanks @sunny appreciate it -- think this works for us!
I wanted to see if we could set validations on currency columns such that we only allow certain currencies to be initialized as Money objects or saved to currency columns (for example, USD and MXN) and/or disable others (GBP, EUR).