Skip to content

Commit

Permalink
Format date with #to_fs
Browse files Browse the repository at this point in the history
The #to_s(format) method was deprecated and removed from Rails 7.1.
This is causing `ActionView::Template::Error wrong number of arguments (given 1, expected 0)`
when a tax rate with an expiration date is displayed.
  • Loading branch information
alepore authored and MadelineCollier committed Oct 9, 2024
1 parent bb60ce1 commit 7f7f275
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/tax_rates/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<td><%= tax_rate.amount %></td>
<td><%= tax_rate.included_in_price? ? t('spree.say_yes') : t('spree.say_no') %></td>
<td><%= tax_rate.show_rate_in_label? ? t('spree.say_yes') : t('spree.say_no') %></td>
<td><%= tax_rate.expires_at.to_date.to_s(:short_date) if tax_rate.expires_at %></td>
<td><%= tax_rate.expires_at.to_date.to_fs(:short_date) if tax_rate.expires_at %></td>
<td><%= tax_rate.calculator && tax_rate.calculator.class.model_name.human %></td>
<td class="actions">
<% if can?(:update, tax_rate) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
click_link "Tax Rates"
click_link "New Tax Rate"
fill_in "Rate", with: "0.05"
fill_in "Expiration Date", with: "2050-01-01"
click_button "Create"
expect(page).to have_content("Tax Rate has been successfully created!")
end
Expand Down

0 comments on commit 7f7f275

Please sign in to comment.