Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save guipdutra/5826339 to your computer and use it in GitHub Desktop.
Save guipdutra/5826339 to your computer and use it in GitHub Desktop.
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