Skip to content

Commit

Permalink
Use Order#email to show the order's email in new admin
Browse files Browse the repository at this point in the history
`spree_orders` table has the column `email` which stores the email of
guest orders or users email for non guest orders. We should use
that in the new admin to display the email so that guest orders work
as well.

(cherry picked from commit 93abf41)
  • Loading branch information
softr8 committed Dec 4, 2024
1 parent b5f5e0a commit 6f3802d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def customer_column
col: { class: "w-[400px]" },
header: :customer,
data: ->(order) do
customer_email = order.user&.email
customer_email = order.email
content_tag :div, String(customer_email)
end
}
Expand Down
1 change: 1 addition & 0 deletions admin/spec/features/orders/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
visit "/admin/orders"
click_on "In Progress"

expect(page).to have_content("[email protected]")
expect(page).to have_content("R123456789")
expect(page).to have_content("$19.99")
expect(page).to be_axe_clean
Expand Down

0 comments on commit 6f3802d

Please sign in to comment.