Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Fund::CreateCallForm < BaseForm
  2. property :type
  3. property :fund
  4.  
  5. validation do
  6. required(:type) { filled? & included_in?(TRANSACTION_TYPES['Fund::Call']) }
  7. end
  8.  
  9. validation if: -> (results) { rebalance? } do
  10. required(:fund).filled
  11. end
  12.  
  13. def rebalance?
  14. self.type == 'rebalance'
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement