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

Allow the bank to function as a coder. #15

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Conversation

ioquatix
Copy link
Owner

@ioquatix ioquatix commented Nov 6, 2023

Allows a bank instance to function as a coder, which accepts more reasonable "human" formatted amounts:

#12

require 'latinum/currencies/global'

class T < ApplicationRecord
  BANK = Latinum::Bank.new.tap do |bank|
    bank.import(Latinum::Currencies::Global)
  end
  
  serialize :amount, coder: BANK
end

@ioquatix ioquatix merged commit 24a908b into main Nov 6, 2023
36 checks passed
@ioquatix ioquatix deleted the bank-serializer-support branch November 6, 2023 23:28
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

Successfully merging this pull request may close these issues.

1 participant