spree/spree — pull request #3727 by huoxito (2013-09-15 03:49:52+00:00)
Title: Fix ReadOnlyError when destroying StockItem

StockMovement is a read only object so we can't delete them. And by that
logic I believe we shouldn't clear stock items from the database either
otherwise we will have stock movements associated with non existing
stock items

Wdyt? This should fix the issue reported in #3723 but there's still stuff related to fix / discuss. Maybe we also need to make so that stock locations are never cleared from db as well. And we still need to unscope stock items from a stock movement perspective otherwise we will have the same trouble when trying to fetch removed items in a stock movement object.