Before_validation callback or callbacks?

I need to perform an amount normalization before validation, I can do it
with a callback
before_validation :normalize_totalAmount … fine
BUT I need to perform the same normalization on 3 amounts…
should I write 3 different before_validation callbacks
(:normalize_totalAmount, normalize_partPaymentAmount and
:normalize_depositAmount) with 3 methods

can I write something like :

before_validation :normalize_Amount => totalAmount

and write a single method but in this case how can I pass the amount
value nd get it back the normalized one ??

def normalize_amount(n)


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs