I have, `Transaction.has_many :splits` and Split has an amount:integer 
attribute. I'd like to ensure `transaction.splits = [split1, split2, ...]` 
the sum of split1.amount + split2.amount + ... == 0. It seems that 
:before_add deals with the splits one by one whereas what I'd like is to 
check the array that's being assigned (`[split1, ..]`) beforehand. Is such 
a thing possible?


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/96ufvG0qMRwJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to