Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.requires_additional_billable_item(account, billable_type_id)
- # ID | Billable Type
- # 2 | User
- billabable_count = account.billables.find_all_by_billable_type_id(billable_type_id).count
- comparison_count = case billable_type_id
- when 2
- account.users.count
- end
- comparison_count >= billabable_count
- end
Add Comment
Please, Sign In to add comment