Guest User

Untitled

a guest
Jan 21st, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def self.requires_additional_billable_item(account, billable_type_id)
  2. # ID | Billable Type
  3. # 2 | User
  4.  
  5.  
  6. billabable_count = account.billables.find_all_by_billable_type_id(billable_type_id).count
  7.  
  8. comparison_count = case billable_type_id
  9. when 2
  10. account.users.count
  11. end
  12.  
  13. comparison_count >= billabable_count
  14. end
Add Comment
Please, Sign In to add comment