You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spree backend, as Admin, when you delete a SalePrice associated to a product, the relation between Product, Price and SalePrice is removed, but SalePrice persist in the database keeping the relation between Variant, Price and SalePrice
The text was updated successfully, but these errors were encountered:
I cannot reproduce. In my setup (Spree 2.2, Rails 4) the record seems to be removed:
Started DELETE "/admin/products/ruby-on-rails-mug/sale_prices/13" for 127.0.0.1 at 2014-08-07 16:18:08 +0200
Processing by Spree::Admin::SalePricesController#destroy as JS
Parameters: {"authenticity_token"=>"dvEJgMurZZ6cg5DjoPS2jdpg6Q1LCBlhCnjQCcKHnDQ=", "product_id"=>"ruby-on-rails-mug", "id"=>"13"}
.... Cut out irrelevant Queries ....
Spree::SalePrice Load (0.2ms) SELECT "spree_sale_prices".* FROM "spree_sale_prices" WHERE "spree_sale_prices"."id" = ? LIMIT 1 [["id", "13"]]
(0.1ms) begin transaction
Spree::Calculator Load (0.3ms) SELECT "spree_calculators".* FROM "spree_calculators" WHERE "spree_calculators"."calculable_id" = ? AND "spree_calculators"."calculable_type" = ? LIMIT 1 [["calculable_id", 13], ["calculable_type", "Spree::SalePrice"]]
SQL (0.5ms) DELETE FROM "spree_calculators" WHERE "spree_calculators"."type" IN ('Spree::Calculator::DollarAmountSalePriceCalculator') AND "spree_calculators"."id" = ? [["id", 19]]
SQL (0.3ms) DELETE FROM "spree_sale_prices" WHERE "spree_sale_prices"."id" = ? [["id", 13]]
(2.7ms) commit transaction
The last query removes it.
Could it be that, when adding a sale-price it gets added twice? and on deletion only one is deleted? That is what happens with my setup (refer issue: #4). I mean: after deleting a newly added sale price: it is added twice. After removing one, one other persists, since it was added double.
In Spree backend, as Admin, when you delete a SalePrice associated to a product, the relation between Product, Price and SalePrice is removed, but SalePrice persist in the database keeping the relation between Variant, Price and SalePrice
The text was updated successfully, but these errors were encountered: