Maikel Linke
2201d2e8c2
VariantOverride with on_demand now overriding stock
...
Otherwise we would try to take stock from the producer stock level
without respecting their on-demand settings. So from now on:
If stock level or on_demand are set on the override then it's not using
producer stock levels.
2024-08-02 14:40:17 +10:00
Maikel Linke
b6c407971d
Allow on-demand VariantOverride to track stock
...
We allowed this for producer stock and need to do the same for inventory
stock. This will allow us to create backorders for missing, but promised
stock.
2024-08-02 14:40:17 +10:00
Maikel Linke
6317fe1b71
Disable RSpec monkey patching
2024-05-09 12:24:41 +10:00
Maikel Linke
bd6b0ddbf3
Enforce RSpec expect(..).not_to over to_not
2024-03-07 16:57:54 +11:00
Neal Chambers
35e8f88943
Fix Style/HashSyntax
2023-09-24 22:41:27 +09:00
Neal Chambers
728926cc9a
Fix Layout/LineLength
2023-07-19 08:39:26 +09:00
Luis Ramos
23627c5453
Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
...
9290 issues fixed
2021-06-17 22:19:26 +01:00
Jean-Baptiste Bellet
7f5e58bcc3
Uncomment flaky (?) spec
2021-06-15 13:51:40 +02:00
Luis Ramos
2b8f0abe49
Try some mass auto-correct adding frozen-string-literal to all specs
2020-12-03 06:38:24 -08:00
Arun Kumar Mohan
362ab8a605
Improve variant override specs' performance
2020-10-01 01:43:08 -05:00
Arun Kumar Mohan
239b6e7577
Replace create with build_stubbed in variant override model specs
2020-09-21 00:45:35 -05:00
Luis Ramos
eb4d648a23
Comment this very flaky spec for now
2020-07-10 19:27:31 +01:00
Matt-Yorkley
d3de1ce47e
Add spec for current soft deletion behaviour in VariantOverride#indexed
2020-05-05 13:57:50 +02:00
Matt-Yorkley
ab330e882e
Remove product cache
2019-10-18 21:15:11 +01:00
Matt-Yorkley
a15db65e69
Reload tested variant and price objects
2019-09-11 04:32:19 +01:00
Matt-Yorkley
f413ce2a27
Soft-delete price objects
2019-09-06 17:50:19 +01:00
Matt-Yorkley
fc9f61ecf8
Revert PR #4204
...
Temporarily reverting these changes for a quick release
2019-09-05 13:23:59 +01:00
Matt-Yorkley
62341c6381
Unit test access to associated objects after soft-delete
2019-08-31 10:06:47 +01:00
luisramos0
86b0d71c7e
Result of rubocop auto-correct and rebuilding rubocop_manual_todo
2019-05-28 12:57:29 +01:00
luisramos0
2cc8a0e9e3
Fix models/variant_override_spec by setting mandatory on_demand true when count_on_hand is nil
2019-01-08 15:32:10 +00:00
luisramos0
e28f9a7c84
Merge branch 'master' into 2-0-stable-jan-8th
2019-01-08 14:29:50 +00:00
Kristina Lim
34313c94ca
Make reset stock settings for VO force limited stock
2018-12-09 21:47:05 +08:00
Kristina Lim
83b6973bc2
Require compatible VO on_demand and count_on_hand
2018-12-07 14:39:36 +08:00
luisramos0
d962358f15
Fix rubocop and transpec models/variant_override and its spec
2018-11-30 00:43:55 +00:00
luisramos0
0577011f5b
Refactor variant override model and its spec: simplify move_stock and remove unused methods
2018-11-30 00:22:04 +00:00
niko
3ae38178a3
Move query from variant_overrides_controller to its model scope
2018-10-04 02:43:02 +02:00
Pierre de Lacroix
f67a8c1f2d
Add tests
2017-12-01 13:37:24 +11:00
Rob Harrington
348ab81c42
Overriding #increment! using variant overrides
2017-05-05 14:20:57 +10:00
Rohan Mitchell
422061f137
Merge branch 'master' into products-caching
...
Conflicts:
app/controllers/shop_controller.rb
app/models/enterprise_fee.rb
app/models/order_cycle.rb
app/models/variant_override.rb
db/schema.rb
lib/open_food_network/products_renderer.rb
spec/lib/open_food_network/products_renderer_spec.rb
2016-03-03 09:42:52 +11:00
Rob Harrington
4bf27982f4
Applying variant override permissions when they are added or removed
...
Also remove variant overrides with revoked permissions from the default scope
2016-03-02 12:10:49 +11:00
Rohan Mitchell
5f188650d8
Trigger cache refresh on VariantOverride save/destroy
2016-02-24 15:05:01 +11:00
Steve Pettitt
e423e890e0
Changed name enable_reset to resettable in Variant Overrides table & updated views, specs accordingly
2016-01-15 09:07:50 +11:00
Steve Pettitt
0ee078e232
Added toggle to enable/disable reset stock. Updated specs
2016-01-15 09:07:48 +11:00
Rob Harrington
53d97dab08
WIP: Adding view and routes for resetting variant_overrides count_on_hand
2016-01-15 09:07:48 +11:00
Rohan Mitchell
aa0a031fa0
Fetch indexed variant overrides in one go
2015-06-18 15:03:24 +10:00
Rohan Mitchell
97e49c2bdb
Replace 'array.sort.should == expected.sort' pattern with match_array
2015-05-28 10:46:08 +10:00
Rohan Mitchell
a4d4622521
Add VariantOverride.decrement_stock
2015-01-12 10:39:23 +11:00
Rohan Mitchell
20f650b472
Add VariantOverride.stock_overriden?
2015-01-12 09:32:02 +11:00
Rohan Mitchell
f5ee9ba2f3
VariantOverride looks up count_on_hand
2014-12-18 10:21:07 +11:00
Rohan Mitchell
91c500417b
Swap param order
2014-12-17 08:55:27 +11:00
Rohan Mitchell
ff28da345d
Find variant overrides for some hubs
2014-12-12 13:33:12 +11:00
Rohan Mitchell
f9b4c07219
Add initial VariantOverride model with price lookup
2014-11-21 13:49:09 +11:00