Skip to content

Commit

Permalink
Refactor transaction creation in TransactionUseCase
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianoflorentino committed Mar 13, 2024
1 parent 8c2bc2f commit 0f141e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/use_cases/transaction_use_case/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ def initialize(customer_id, transaction_params)

def call
transaction = Transaction.new(customer_id: @customer_id, amount: @amount, kind: @kind, description: @description)
transaction.valid?
transaction.save!
transaction&.save!

transaction
end
Expand Down

0 comments on commit 0f141e6

Please sign in to comment.