Created
June 20, 2013 20:32
-
-
Save guipdutra/5826339 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 BudgetRevenueDeductionsController < CrudController | |
protected | |
def create_resource(object) | |
object.descriptor = current_descriptor | |
object.transaction do | |
if super | |
MovementsGenerator.new(object).generate! | |
Withdraw.new.withdraw_funds!(object.bank_account, | |
object.amount, | |
Date.current, | |
object) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment