This removes the deprecation warning:
```
[WARNING] The default currency will change from `USD` to `nil` in the
next major release. Make sure to set it explicitly using
`Money.default_currency=` to avoid potential issues
```
This removes the deprecation warning:
```
[WARNING] The default rounding mode will change from `ROUND_HALF_EVEN`
to `ROUND_HALF_UP` in the next major release. Set it explicitly using
`Money.rounding_mode=` to avoid potential problems.
```
by specifying the default rounding mode at boot time so that it's only
set once for the whole app. See
https://github.com/RubyMoney/money#rounding for details.
We set this value to `true` unconditionally in an initializer, and then check the value in various places via Spree::Config. It's never false, and it's not configurable, so we can just drop it and remove the related conditionals. 🔥
This will log any N+1 it finds, pointing to the line causing it and
a way to solve it, aka. which `#includes` to add. Like so
```
web_1 | GET /admin/order_cycles.json?ams_prefix=index&q%5Borders_close_at_gt%5D=Sun+Jan+31+2021+00:00:00+GMT%2B0100+(Central+European+Standard+Time)
web_1 | USE eager loading detected
web_1 | OrderCycle => [:coordinator]
web_1 | Add to your query: .includes([:coordinator])
web_1 | Call stack
web_1 | /usr/src/app/app/serializers/api/admin/index_order_cycle_serializer.rb:41:in `coordinator'
web_1 | /usr/src/app/app/controllers/spree/admin/base_controller.rb:98:in `render_as_json'
web_1 | /usr/src/app/app/controllers/admin/order_cycles_controller.rb:17:in `block (2 levels) in index'
web_1 | /usr/src/app/app/controllers/admin/order_cycles_controller.rb:14:in `index'
web_1 | bin/rails:4:in `require'
web_1 | bin/rails:4:in `<main>'
```
We gave a try at Bullet long ago and abandoned it because it's not
a silver bullet (pun intended) due to false positives. However, it's
pretty clear that this won't happen often; we have endless N+1 still to fix.
I recently experienced how, relying on Bullet made it just extra 30s to fix
additional N+1s other than the one I was fixing. Usually, finding the
culprit line takes me more of 30min.
The aim of this "feature toggle" is to enable the unit price display for each product/variants.
By default activate on both development and staging environment.
This enables toggling features as best fits us in each case. With this
new approach we can then toggle :customer_balance to an entire instance,
which is what we want in France.
It doesnt work in rails 5 and apparently it was introduced to debug already deleted products cache in staging
See this commit that introduced it 10a79d5a65
Spree used to give you more options to configure ActionMailer but our
setup is much simpler. We can remove unused code.
The removed option was never used by OFN and defaulted to true. We don't
need a database migration because the value isn't set in the database.
This enables the use of the new customer balance implementation to
whatever users we specify in the BETA_TESTERS env var through
ofn-install.
This var is meant to contain the user emails that will log in such as
personal accounts (I have an account with admin access to my hub) or
superadmin accounts used by the core team. This way can gather early
feedback ourselves while not releasing the new logic to users.
Patches Paranoia gem to fix a conflict with transactions in Rspec: https://github.com/rubysherpas/paranoia/issues/274
Example error:
```
Failure/Error: order.line_items.first.variant.tap(&:delete)
NoMethodError:
undefined method `state' for #<ActiveRecord::ConnectionAdapters::NullTransaction:0x0000564117dddd18>
```
Before people were unable to remove coordinator fees from an order cycle because Rails was converting the empty :coordinator_fee_ids array paramter into nil. This issue was introduced to Rails in v4.0.0.beta1 and isn't fixed until v5.0.0.beta1
Another way to fix this could be to do something like 'params[:coordinator_fee_ids] ||= []' but it seems like this issue could problems in other parts of the app so a more general fix might be better.
Fixes#6224