solidus_promotions 4.7.3 → 4.7.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8973cbc4bee6e19cc5bd9ff3b1fac94db5a7e662f7f21d201b16bd21f40c5abc
|
|
4
|
+
data.tar.gz: d4d3efb30230e86e2268179cda2bb5f24b747d144e15198ef30f667f250340d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80f847a06f7e5dd77c33c41a473e7fc89ea86a989e7fb53e322258f85071be9c3b07b59c58874350e6414abab14367937eb4c21fffa4be2fc9aaa040ee11c7bb
|
|
7
|
+
data.tar.gz: 38f5d27856ffc32d56ceac057eaae49084a1ef6898ea34e3aa8a1b07e7a2b72e0467dee1551e73d146b137872271d83e9c37f48f7d504d99ac2ffcbd077703b7
|
|
@@ -12,7 +12,7 @@ module SolidusPromotions
|
|
|
12
12
|
|
|
13
13
|
def index
|
|
14
14
|
promotions = apply_search_to(
|
|
15
|
-
|
|
15
|
+
accessible_promotions.order(id: :desc),
|
|
16
16
|
param: :q
|
|
17
17
|
)
|
|
18
18
|
|
|
@@ -25,6 +25,7 @@ module SolidusPromotions
|
|
|
25
25
|
|
|
26
26
|
def destroy
|
|
27
27
|
@promotions = SolidusPromotions::Promotion.where(id: params[:id])
|
|
28
|
+
@promotions.each { authorize! :destroy, _1 }
|
|
28
29
|
|
|
29
30
|
SolidusPromotions::Promotion.transaction { @promotions.destroy_all }
|
|
30
31
|
|
|
@@ -34,6 +35,12 @@ module SolidusPromotions
|
|
|
34
35
|
|
|
35
36
|
private
|
|
36
37
|
|
|
38
|
+
def accessible_promotions
|
|
39
|
+
return SolidusPromotions::Promotion.all if current_ability.has_block?(:index, SolidusPromotions::Promotion)
|
|
40
|
+
|
|
41
|
+
SolidusPromotions::Promotion.accessible_by(current_ability, :index)
|
|
42
|
+
end
|
|
43
|
+
|
|
37
44
|
def load_promotion
|
|
38
45
|
@promotion = SolidusPromotions::Promotion.find_by!(number: params[:id])
|
|
39
46
|
authorize! action_name, @promotion
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidus_promotions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.7.
|
|
4
|
+
version: 4.7.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Meyerhoff
|
|
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
413
413
|
- !ruby/object:Gem::Version
|
|
414
414
|
version: '0'
|
|
415
415
|
requirements: []
|
|
416
|
-
rubygems_version: 4.0.
|
|
416
|
+
rubygems_version: 4.0.20
|
|
417
417
|
specification_version: 4
|
|
418
418
|
summary: New promotion system for Solidus
|
|
419
419
|
test_files: []
|