This means we violated the business rules of having a single stock
location for the OFN instance and hence a single stock item per variant.
Although it is too late to preserve the data integrity we can know data
needs to be cleaned up.
This will prevent other devs from relying on this methods and will tell
us the exact lines that call this methods, which will come in handy when
removing this module.
This also replaces the after_save callback to after_update.
We enforce a stock_item exists when modifying the variant and the
stock_item gets created on variant's after_create. This means it's not
possible to use any of the VariantStock's setters before the variant is
persisted so executing the callback on creation is pointless.
This change could impact the performance of the report. But therefore it
takes VariantOverrides into consideration. The old code ignored the
distributor for this filter. It also ignored the `on_demand` flag.
When a user hit cancel while editing a product it took them to the spree
products index page instead of the bulk edit page. The button was part
of a shared view for all resources so changing it's actions were not
readily available.
It was suggested that instead of carrying our own separate controller
action we could just override the index action of the products
controller with the bulk edit functionality instead. This has the
advantage of removing some overrides and allows us to not add
additional overrides in the future.
Currently the first user is not confirmed until running the task
`openfoodnetwork:dev:load_sample_data`. This task does not need to be
run on a minimum implementation of a new server or development setup.
We now confirm the first user during seeding. This could be the default
email address or the user entered email address entered during seeding.
As opposed the to sample users and enterprises that ease testing and
development, the mail method is needed for the app to function in any
environment.