Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fund::CreateCallForm < BaseForm
- property :type
- property :fund
- validation do
- required(:type) { filled? & included_in?(TRANSACTION_TYPES['Fund::Call']) }
- end
- validation if: -> (results) { rebalance? } do
- required(:fund).filled
- end
- def rebalance?
- self.type == 'rebalance'
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement