spree_sample 3.6.1 → 3.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/samples/promotions.rb +23 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab6fdacad17a4143c2e2447ccfbce334850aeff1e7df18e39784769a1e7caea6
|
4
|
+
data.tar.gz: 54e71b22f5240aa32f4a924d592046af6c2e25832d4e52bd0dfc811654cd93a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ce192dc914660d5943da21928a90eaac0a87e11637c0693084f673d2923c3ca5d71499e16c5a95d5e8d9c47c4ea3aa6d8238255237bcac18faffe6237e8e565
|
7
|
+
data.tar.gz: 60e3c64f422eab2abb62103518ca49883972aac74460e037caf255a259beea208dd0acd63a1ef75100fed5f6dc2a60fa09697ff9cf896cac3474abebb17590b0
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Spree::Sample.load_sample('option_values')
|
2
|
+
Spree::Sample.load_sample('products')
|
3
|
+
|
4
|
+
product = Spree::Product.find_by(name: 'Ruby on Rails Baseball Jersey')
|
5
|
+
size = Spree::OptionValue.find_by(name: 'Small')
|
6
|
+
color = Spree::OptionValue.find_by(name: 'Red')
|
7
|
+
eligible_values = "#{size.id},#{color.id}"
|
8
|
+
|
9
|
+
promotion = Spree::Promotion.where(
|
10
|
+
name: 'free shipping',
|
11
|
+
usage_limit: nil,
|
12
|
+
path: nil,
|
13
|
+
match_policy: 'any',
|
14
|
+
description: ''
|
15
|
+
).first_or_create
|
16
|
+
|
17
|
+
Spree::PromotionRule.where(
|
18
|
+
promotion_id: promotion.id,
|
19
|
+
type: 'Spree::Promotion::Rules::OptionValue',
|
20
|
+
preferences: { match_policy: 'any', eligible_values: { product.id.to_s => eligible_values } }
|
21
|
+
).first_or_create
|
22
|
+
|
23
|
+
Spree::Promotion::Actions::FreeShipping.where(promotion_id: promotion.id).first_or_create
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_sample
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.6.
|
19
|
+
version: 3.6.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.6.
|
26
|
+
version: 3.6.2
|
27
27
|
description: Required dependency for Spree
|
28
28
|
email: sean@spreecommerce.com
|
29
29
|
executables: []
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- db/samples/product_option_types.rb
|
78
78
|
- db/samples/product_properties.rb
|
79
79
|
- db/samples/products.rb
|
80
|
+
- db/samples/promotions.rb
|
80
81
|
- db/samples/prototypes.rb
|
81
82
|
- db/samples/shipping_categories.rb
|
82
83
|
- db/samples/shipping_methods.rb
|