Skip to content

Commit

Permalink
Use the memo instead of title
Browse files Browse the repository at this point in the history
  • Loading branch information
hjhart committed Dec 2, 2016
1 parent ae5802f commit a5c0274
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Item
attribute :title, String
attribute :total_price, MoneyAttribute
attribute :tracking_number, String
attribute :quantity, Integer
attribute :quantity, Integer, default: 1

def memo
quantity > 1 ? "#{quantity} of #{title}" : title
Expand Down
4 changes: 2 additions & 2 deletions app/models/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def transactions
items = TransactionResolver.new(remaining_items: remaining_items, fulfillment: fulfillment).items
if items.size > 1
memo = 'MULTIPLE ITEMS –– '
memo += items.map { |item| "#{item.title} #{item.total_price.format}"}.join(' ')
memo += items.map { |item| "#{item.memo} #{item.total_price.format}"}.join(' ')
elsif items.size == 1
memo = items.first.title
memo = items.first.memo
else
memo = 'Unknown'
end
Expand Down

0 comments on commit a5c0274

Please sign in to comment.