Guest User

Untitled

a guest
Apr 26th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. validate :checkpercentages
  2.  
  3. def checkpercentages
  4. errors.add_to_base("Workareas must add up to 100%!") unless self.reportworkareas.collect {|x| x.percentage}.sum == 100
  5. end
Add Comment
Please, Sign In to add comment