We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A currency column type would be very useful to have in this gem. Here's what I've used in the core to get what I was looking for.
class CurrencyType < ActiveRecord::Type::String def serialize(value) return value.iso_code if value.respond_to?(:iso_code) super end def cast(value) Money::Currency.new(value) end end attribute :base, CurrencyType.new attribute :counter, CurrencyType.new
Would be nice if the gem also registered the type so it could just be attribute :base, :currency
attribute :base, :currency
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A currency column type would be very useful to have in this gem. Here's what I've used in the core to get what I was looking for.
Would be nice if the gem also registered the type so it could just be
attribute :base, :currency
The text was updated successfully, but these errors were encountered: