Skip to content

Commit

Permalink
Refactor transaction extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianoflorentino committed Mar 13, 2024
1 parent 7d1918a commit 8c2bc2f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/use_cases/transaction_use_case/extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ def initialize(customer_id)
end

def call
extract
end

private

def extract
{
extract: {
balance: {
Expand All @@ -35,8 +29,10 @@ def extract
}
end

private

def transactions
transactions ||= Transaction.includes(:customer).where(customer_id: @customer_id)
transactions = Transaction.includes(:customer).where(customer_id: @customer_id)
transactions.order(created_at: :desc).limit(10)
end

Expand Down

0 comments on commit 8c2bc2f

Please sign in to comment.