ฉันใช้ราง 5.2.3
หากฉันสืบทอด Active Record ฉันสามารถใช้ before_validation
callback ได้อย่างแน่นอน แต่ฉันใช้ include ActiveModel::Model
แบบนี้เท่านั้น
# MortgageAmount model
class MortgageAmount
include ActiveModel::Model
end
ดูเหมือนว่าฉันไม่สามารถโทรกลับ before_validation
ได้ ฉันควรรวมองค์ประกอบอื่นเพื่อให้มี before_validation
โทรกลับหรือไม่