solidus_legacy_promotions 4.7.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/spree/permission_sets/promotion_display.rb +10 -0
- data/app/models/spree/permission_sets/promotion_management.rb +10 -0
- data/app/models/spree/promotion/actions/create_quantity_adjustments.rb +7 -0
- data/app/models/spree/promotion/order_adjustments_recalculator.rb +4 -1
- metadata +7 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccd522e470eaf2638d0a814ddec0a320f9dcbb3efb14c2a2c1acb92effe2f146
|
|
4
|
+
data.tar.gz: d76bad24645c68b02b6635a6522004f6eb637829806298f6fc715fd0311a8612
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a70d0cb3636f645466b3066d2cf13c32451a682d43c4fff1c9c0b8efaada28568c138ecae485ca4029028ca1b3970e93c82c750f42d4b6b1650a359d61b5c868
|
|
7
|
+
data.tar.gz: 6b8a1d6c7483d78135faac5bc957cd3a604901d449afb20a181c4b0c5226ec30b22f9ff43630414235dcb2ae7f3024fe7c4ec3899d7326f17c8bee1f747c39e9
|
|
@@ -13,6 +13,16 @@ module Spree
|
|
|
13
13
|
# - Promotion categories
|
|
14
14
|
# - Promotion codes
|
|
15
15
|
class PromotionDisplay < PermissionSets::Base
|
|
16
|
+
class << self
|
|
17
|
+
def privilege
|
|
18
|
+
:display
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def category
|
|
22
|
+
:promotion
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
16
26
|
def activate!
|
|
17
27
|
can [:read, :admin, :edit], Spree::Promotion
|
|
18
28
|
can [:read, :admin], Spree::PromotionRule
|
|
@@ -13,6 +13,16 @@ module Spree
|
|
|
13
13
|
# - Promotion categories
|
|
14
14
|
# - Promotion codes
|
|
15
15
|
class PromotionManagement < PermissionSets::Base
|
|
16
|
+
class << self
|
|
17
|
+
def privilege
|
|
18
|
+
:management
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def category
|
|
22
|
+
:promotion
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
16
26
|
def activate!
|
|
17
27
|
can :manage, Spree::Promotion
|
|
18
28
|
can :manage, Spree::PromotionRule
|
|
@@ -111,6 +111,13 @@ module Spree
|
|
|
111
111
|
line_item_action = line_item_actions.where(
|
|
112
112
|
line_item_id: line_item.id
|
|
113
113
|
).first_or_initialize
|
|
114
|
+
|
|
115
|
+
if line_item_action.persisted?
|
|
116
|
+
line_item.line_item_actions
|
|
117
|
+
.find { |action| action.id == line_item_action.id }
|
|
118
|
+
.quantity = quantity
|
|
119
|
+
end
|
|
120
|
+
|
|
114
121
|
line_item_action.quantity = quantity
|
|
115
122
|
end
|
|
116
123
|
|
|
@@ -70,7 +70,10 @@ module Spree
|
|
|
70
70
|
|
|
71
71
|
adjustment.eligible = calculate_eligibility(adjustment)
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
if persist
|
|
74
|
+
adjustment.save!(validate: false)
|
|
75
|
+
adjustment.adjustable.line_item_actions.find_all(&:changed?).each(&:save!) if adjustment.adjustable.respond_to?(:line_item_actions)
|
|
76
|
+
end
|
|
74
77
|
end
|
|
75
78
|
adjustment.amount
|
|
76
79
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidus_legacy_promotions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.7.
|
|
4
|
+
version: 4.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Solidus Team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: csv
|
|
@@ -30,28 +29,28 @@ dependencies:
|
|
|
30
29
|
requirements:
|
|
31
30
|
- - '='
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 4.7.
|
|
32
|
+
version: 4.7.1
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - '='
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 4.7.
|
|
39
|
+
version: 4.7.1
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: solidus_core
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
44
|
- - '='
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 4.7.
|
|
46
|
+
version: 4.7.1
|
|
48
47
|
type: :runtime
|
|
49
48
|
prerelease: false
|
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
50
|
requirements:
|
|
52
51
|
- - '='
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 4.7.
|
|
53
|
+
version: 4.7.1
|
|
55
54
|
- !ruby/object:Gem::Dependency
|
|
56
55
|
name: solidus_support
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -267,7 +266,6 @@ licenses:
|
|
|
267
266
|
- BSD-3-Clause
|
|
268
267
|
metadata:
|
|
269
268
|
rubygems_mfa_required: 'true'
|
|
270
|
-
post_install_message:
|
|
271
269
|
rdoc_options: []
|
|
272
270
|
require_paths:
|
|
273
271
|
- lib
|
|
@@ -282,8 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
282
280
|
- !ruby/object:Gem::Version
|
|
283
281
|
version: 1.8.23
|
|
284
282
|
requirements: []
|
|
285
|
-
rubygems_version:
|
|
286
|
-
signing_key:
|
|
283
|
+
rubygems_version: 4.0.10
|
|
287
284
|
specification_version: 4
|
|
288
285
|
summary: Legacy Solidus promotion system
|
|
289
286
|
test_files: []
|