Created
May 13, 2017 19:22
-
-
Save kellysutton/0db15dd0265fc2725a6ed8767a46b2a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaxCalculationSaver | |
def self.save_taxes!(payroll) | |
total_tax_amount = payroll.employees.map do |employee| | |
TaxCalculator.calculate(payroll, employee) | |
end.sum | |
PayrollSaver.save!(payroll, total_tax_amount: total_tax_amount) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment