spree_sample 1.3.5 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/db/samples/adjustments.rb +4 -4
- data/db/samples/images/apache_baseball.png +0 -0
- data/db/samples/images/ror_bag.jpeg +0 -0
- data/db/samples/images/ror_baseball.jpeg +0 -0
- data/db/samples/images/ror_baseball_back.jpeg +0 -0
- data/db/samples/images/ror_baseball_jersey_back_blue.png +0 -0
- data/db/samples/images/ror_baseball_jersey_back_green.png +0 -0
- data/db/samples/images/ror_baseball_jersey_back_red.png +0 -0
- data/db/samples/images/ror_baseball_jersey_blue.png +0 -0
- data/db/samples/images/ror_baseball_jersey_green.png +0 -0
- data/db/samples/images/ror_baseball_jersey_red.png +0 -0
- data/db/samples/images/ror_jr_spaghetti.jpeg +0 -0
- data/db/samples/images/ror_mug.jpeg +0 -0
- data/db/samples/images/ror_mug_back.jpeg +0 -0
- data/db/samples/images/ror_ringer.jpeg +0 -0
- data/db/samples/images/ror_ringer_back.jpeg +0 -0
- data/db/samples/images/ror_stein.jpeg +0 -0
- data/db/samples/images/ror_stein_back.jpeg +0 -0
- data/db/samples/images/ror_tote.jpeg +0 -0
- data/db/samples/images/ror_tote_back.jpeg +0 -0
- data/db/samples/images/ruby_baseball.png +0 -0
- data/db/samples/images/spree_bag.jpeg +0 -0
- data/db/samples/images/spree_jersey.jpeg +0 -0
- data/db/samples/images/spree_jersey_back.jpeg +0 -0
- data/db/samples/images/spree_mug.jpeg +0 -0
- data/db/samples/images/spree_mug_back.jpeg +0 -0
- data/db/samples/images/spree_ringer_t.jpeg +0 -0
- data/db/samples/images/spree_ringer_t_back.jpeg +0 -0
- data/db/samples/images/spree_spaghetti.jpeg +0 -0
- data/db/samples/images/spree_stein.jpeg +0 -0
- data/db/samples/images/spree_stein_back.jpeg +0 -0
- data/db/samples/images/spree_tote_back.jpeg +0 -0
- data/db/samples/images/spree_tote_front.jpeg +0 -0
- data/db/samples/orders.rb +1 -8
- data/db/samples/products.rb +3 -6
- data/db/samples/shipping_methods.rb +14 -8
- data/db/samples/stock.rb +12 -0
- data/db/samples/taxons.rb +4 -28
- data/db/samples/variants.rb +3 -7
- data/lib/spree_sample.rb +1 -0
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MmFlNWJlOTFlZDFhNjg3NTY5ZWZhNWNiMzE0ZTVlYjhiMjk5NDQzMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NTliNjFiZmM3ZGMwZjFkYmU3ZGE2MjFiYzZmZDk1NmIzZDljZmEwYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YjA5ZTE1YWU4ZjM0YjZiMjBhMjdlNzhhZTIyMzJiMTI4YjBkMzU4ODc1MDFm
|
10
|
+
Mzg2NzYyYWNkMWViY2ZkYTQyMDU4NGY2ODA4YzEwZTAyNDZhNDc1MGE4ZDg4
|
11
|
+
NWQ2NGVjNTk2M2M1ZWE2ODM2MWZiYzk1NDcyOTNiNzUxMzYyYTA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Mzk3NDM5OWZiNDNkMWFlMTkzOGYxOTY3NjFkZWQ0Mzk4N2I3MzJlZjU0MmU2
|
14
|
+
Y2M5ZmUyMjQyYTNhNGRhMGRlNjI0MzcxMTc4MDViMjU2YjE2Y2U0YTdmODJi
|
15
|
+
MDlhNmE3MWUzZDQ3MzMzNjFmYjEyZDI4ZWZlNzhlM2FkODUzMWQ=
|
data/db/samples/adjustments.rb
CHANGED
@@ -8,7 +8,7 @@ first_order.adjustments.create!({
|
|
8
8
|
:source => first_order,
|
9
9
|
:originator => Spree::TaxRate.find_by_name!("North America"),
|
10
10
|
:label => "Tax",
|
11
|
-
:
|
11
|
+
:state => "open",
|
12
12
|
:mandatory => true
|
13
13
|
}, :without_protection => true)
|
14
14
|
|
@@ -17,7 +17,7 @@ last_order.adjustments.create!({
|
|
17
17
|
:source => last_order,
|
18
18
|
:originator => Spree::TaxRate.find_by_name!("North America"),
|
19
19
|
:label => "Tax",
|
20
|
-
:
|
20
|
+
:state => "open",
|
21
21
|
:mandatory => true
|
22
22
|
}, :without_protection => true)
|
23
23
|
|
@@ -26,7 +26,7 @@ first_order.adjustments.create!({
|
|
26
26
|
:source => first_order,
|
27
27
|
:originator => Spree::ShippingMethod.find_by_name!("UPS Ground (USD)"),
|
28
28
|
:label => "Shipping",
|
29
|
-
:
|
29
|
+
:state => "finalized",
|
30
30
|
:mandatory => true
|
31
31
|
}, :without_protection => true)
|
32
32
|
|
@@ -35,6 +35,6 @@ last_order.adjustments.create!({
|
|
35
35
|
:source => last_order,
|
36
36
|
:originator => Spree::ShippingMethod.find_by_name!("UPS Ground (USD)"),
|
37
37
|
:label => "Shipping",
|
38
|
-
:
|
38
|
+
:state => "finalized",
|
39
39
|
:mandatory => true
|
40
40
|
}, :without_protection => true)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/db/samples/orders.rb
CHANGED
@@ -5,15 +5,11 @@ order = Spree::Order.create!({
|
|
5
5
|
:email => "spree@example.com",
|
6
6
|
:item_total => 150.95,
|
7
7
|
:adjustment_total => 150.95,
|
8
|
-
:shipping_method => Spree::ShippingMethod.first,
|
9
8
|
:total => 301.90,
|
10
9
|
:shipping_address => Spree::Address.first,
|
11
10
|
:billing_address => Spree::Address.last
|
12
11
|
}, :without_protection => true)
|
13
|
-
|
14
|
-
order.create_shipment!
|
15
12
|
order.state = "complete"
|
16
|
-
order.completed_at = Time.now - 1.day
|
17
13
|
order.save!
|
18
14
|
|
19
15
|
order = Spree::Order.create!({
|
@@ -22,12 +18,9 @@ order = Spree::Order.create!({
|
|
22
18
|
:item_total => 15.95,
|
23
19
|
:adjustment_total => 15.95,
|
24
20
|
:total => 31.90,
|
25
|
-
:shipping_method => Spree::ShippingMethod.first,
|
26
21
|
:shipping_address => Spree::Address.first,
|
27
22
|
:billing_address => Spree::Address.last
|
28
23
|
}, :without_protection => true)
|
29
|
-
|
30
|
-
order.create_shipment!
|
31
24
|
order.state = "complete"
|
32
|
-
order.completed_at = Time.now - 1.day
|
33
25
|
order.save!
|
26
|
+
|
data/db/samples/products.rb
CHANGED
@@ -8,7 +8,7 @@ default_attrs = {
|
|
8
8
|
}
|
9
9
|
|
10
10
|
products = [
|
11
|
-
{
|
11
|
+
{
|
12
12
|
:name => "Ruby on Rails Tote",
|
13
13
|
:tax_category => clothing,
|
14
14
|
:price => 15.99,
|
@@ -103,19 +103,16 @@ products = [
|
|
103
103
|
}
|
104
104
|
]
|
105
105
|
|
106
|
-
# Need to call reset_column information here
|
107
|
-
# Otherwise running db:migrate db:seed spree_sample:load will fail
|
108
|
-
# complaining about cost_currency missing
|
109
|
-
Spree::Variant.reset_column_information
|
110
|
-
|
111
106
|
products.each do |product_attrs|
|
112
107
|
eur_price = product_attrs.delete(:eur_price)
|
113
108
|
Spree::Config[:currency] = "USD"
|
114
109
|
|
110
|
+
default_shipping_category = Spree::ShippingCategory.find_by_name!("Default Shipping")
|
115
111
|
product = Spree::Product.create!(default_attrs.merge(product_attrs), :without_protection => true)
|
116
112
|
Spree::Config[:currency] = "EUR"
|
117
113
|
product.reload
|
118
114
|
product.price = eur_price
|
115
|
+
product.shipping_category = default_shipping_category
|
119
116
|
product.save!
|
120
117
|
end
|
121
118
|
|
@@ -7,27 +7,32 @@ rescue ActiveRecord::RecordNotFound
|
|
7
7
|
end
|
8
8
|
|
9
9
|
europe_vat = Spree::Zone.find_by_name!("EU_VAT")
|
10
|
+
shipping_category = Spree::ShippingCategory.find_or_create_by_name!('Default')
|
10
11
|
|
11
12
|
shipping_methods = [
|
12
13
|
{
|
13
14
|
:name => "UPS Ground (USD)",
|
14
|
-
:
|
15
|
-
:calculator => Spree::Calculator::FlatRate.create
|
15
|
+
:zones => [north_america],
|
16
|
+
:calculator => Spree::Calculator::FlatRate.create!,
|
17
|
+
:shipping_categories => [shipping_category]
|
16
18
|
},
|
17
19
|
{
|
18
20
|
:name => "UPS Two Day (USD)",
|
19
|
-
:
|
20
|
-
:calculator => Spree::Calculator::FlatRate.create
|
21
|
+
:zones => [north_america],
|
22
|
+
:calculator => Spree::Calculator::FlatRate.create!,
|
23
|
+
:shipping_categories => [shipping_category]
|
21
24
|
},
|
22
25
|
{
|
23
26
|
:name => "UPS One Day (USD)",
|
24
|
-
:
|
25
|
-
:calculator => Spree::Calculator::FlatRate.create
|
27
|
+
:zones => [north_america],
|
28
|
+
:calculator => Spree::Calculator::FlatRate.create!,
|
29
|
+
:shipping_categories => [shipping_category]
|
26
30
|
},
|
27
31
|
{
|
28
32
|
:name => "UPS Ground (EUR)",
|
29
|
-
:
|
30
|
-
:calculator => Spree::Calculator::FlatRate.create
|
33
|
+
:zones => [europe_vat],
|
34
|
+
:calculator => Spree::Calculator::FlatRate.create!,
|
35
|
+
:shipping_categories => [shipping_category]
|
31
36
|
}
|
32
37
|
]
|
33
38
|
|
@@ -44,6 +49,7 @@ end
|
|
44
49
|
shipping_method = Spree::ShippingMethod.find_by_name!(shipping_method_name)
|
45
50
|
shipping_method.calculator.preferred_amount = price
|
46
51
|
shipping_method.calculator.preferred_currency = currency
|
52
|
+
shipping_method.shipping_categories << Spree::ShippingCategory.first
|
47
53
|
shipping_method.save!
|
48
54
|
end
|
49
55
|
|
data/db/samples/stock.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Spree::Sample.load_sample("variants")
|
2
|
+
|
3
|
+
location = Spree::StockLocation.first_or_create! name: 'default'
|
4
|
+
location.active = true
|
5
|
+
location.country = Spree::Country.where(iso: 'US').first
|
6
|
+
location.save!
|
7
|
+
|
8
|
+
Spree::Variant.all.each do |variant|
|
9
|
+
variant.stock_items.each do |stock_item|
|
10
|
+
Spree::StockMovement.create(:quantity => 10, :stock_item => stock_item)
|
11
|
+
end
|
12
|
+
end
|
data/db/samples/taxons.rb
CHANGED
@@ -94,46 +94,22 @@ taxons = [
|
|
94
94
|
{
|
95
95
|
:name => "Ruby",
|
96
96
|
:taxonomy => brands,
|
97
|
-
:parent => "Brand"
|
98
|
-
:products => [
|
99
|
-
products[:ruby_baseball_jersey]
|
100
|
-
]
|
97
|
+
:parent => "Brand"
|
101
98
|
},
|
102
99
|
{
|
103
100
|
:name => "Apache",
|
104
101
|
:taxonomy => brands,
|
105
|
-
:parent => "Brand"
|
106
|
-
:products => [
|
107
|
-
products[:apache_baseball_jersey]
|
108
|
-
]
|
102
|
+
:parent => "Brand"
|
109
103
|
},
|
110
104
|
{
|
111
105
|
:name => "Spree",
|
112
106
|
:taxonomy => brands,
|
113
|
-
:parent => "Brand"
|
114
|
-
:products => [
|
115
|
-
products[:spree_stein],
|
116
|
-
products[:spree_mug],
|
117
|
-
products[:spree_ringer],
|
118
|
-
products[:spree_baseball_jersey],
|
119
|
-
products[:spree_tote],
|
120
|
-
products[:spree_bag],
|
121
|
-
products[:spree_jr_spaghetti],
|
122
|
-
]
|
107
|
+
:parent => "Brand"
|
123
108
|
},
|
124
109
|
{
|
125
110
|
:name => "Rails",
|
126
111
|
:taxonomy => brands,
|
127
|
-
:parent => "Brand"
|
128
|
-
:products => [
|
129
|
-
products[:ror_tote],
|
130
|
-
products[:ror_bag],
|
131
|
-
products[:ror_mug],
|
132
|
-
products[:ror_stein],
|
133
|
-
products[:ror_baseball_jersey],
|
134
|
-
products[:ror_jr_spaghetti],
|
135
|
-
products[:ror_ringer],
|
136
|
-
]
|
112
|
+
:parent => "Brand"
|
137
113
|
},
|
138
114
|
]
|
139
115
|
|
data/db/samples/variants.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Spree::Sample.load_sample("option_values")
|
2
2
|
Spree::Sample.load_sample("products")
|
3
3
|
|
4
|
-
ror_baseball_jersey = Spree::Product.find_by_name!("Ruby on Rails Baseball Jersey")
|
4
|
+
ror_baseball_jersey = Spree::Product.find_by_name!("Ruby on Rails Baseball Jersey")
|
5
5
|
ror_tote = Spree::Product.find_by_name!("Ruby on Rails Tote")
|
6
6
|
ror_bag = Spree::Product.find_by_name!("Ruby on Rails Bag")
|
7
7
|
ror_jr_spaghetti = Spree::Product.find_by_name!("Ruby on Rails Jr. Spaghetti")
|
@@ -27,10 +27,6 @@ red = Spree::OptionValue.find_by_name!("Red")
|
|
27
27
|
blue = Spree::OptionValue.find_by_name!("Blue")
|
28
28
|
green = Spree::OptionValue.find_by_name!("Green")
|
29
29
|
|
30
|
-
default_attrs = {
|
31
|
-
:count_on_hand => 10
|
32
|
-
}
|
33
|
-
|
34
30
|
variants = [
|
35
31
|
{
|
36
32
|
:product => ror_baseball_jersey,
|
@@ -162,9 +158,9 @@ masters = {
|
|
162
158
|
}
|
163
159
|
|
164
160
|
variants.each do |variant_attrs|
|
165
|
-
Spree::Variant.create!(variant_attrs
|
161
|
+
Spree::Variant.create!(variant_attrs, :without_protection => true)
|
166
162
|
end
|
167
163
|
|
168
164
|
masters.each do |product, variant_attrs|
|
169
|
-
product.master.update_attributes!(variant_attrs
|
165
|
+
product.master.update_attributes!(variant_attrs)
|
170
166
|
end
|
data/lib/spree_sample.rb
CHANGED
@@ -20,6 +20,7 @@ module SpreeSample
|
|
20
20
|
Spree::Sample.load_sample("product_properties")
|
21
21
|
Spree::Sample.load_sample("prototypes")
|
22
22
|
Spree::Sample.load_sample("variants")
|
23
|
+
Spree::Sample.load_sample("stock")
|
23
24
|
Spree::Sample.load_sample("assets")
|
24
25
|
|
25
26
|
Spree::Sample.load_sample("orders")
|
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:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2013-05-13 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:
|
19
|
+
version: 2.0.0.rc1
|
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:
|
26
|
+
version: 2.0.0.rc1
|
27
27
|
description: Required dependency for Spree
|
28
28
|
email: sean@spreecommerce.com
|
29
29
|
executables: []
|
@@ -31,7 +31,9 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
33
|
- LICENSE
|
34
|
-
-
|
34
|
+
- lib/spree/sample.rb
|
35
|
+
- lib/spree_sample.rb
|
36
|
+
- lib/tasks/sample.rake
|
35
37
|
- db/samples/addresses.rb
|
36
38
|
- db/samples/adjustments.rb
|
37
39
|
- db/samples/assets.rb
|
@@ -80,14 +82,13 @@ files:
|
|
80
82
|
- db/samples/shipments.rb
|
81
83
|
- db/samples/shipping_categories.rb
|
82
84
|
- db/samples/shipping_methods.rb
|
85
|
+
- db/samples/stock.rb
|
83
86
|
- db/samples/tax_categories.rb
|
84
87
|
- db/samples/tax_rates.rb
|
85
88
|
- db/samples/taxonomies.rb
|
86
89
|
- db/samples/taxons.rb
|
87
90
|
- db/samples/variants.rb
|
88
|
-
-
|
89
|
-
- lib/spree_sample.rb
|
90
|
-
- lib/tasks/sample.rake
|
91
|
+
- db/samples.rb
|
91
92
|
homepage: http://spreecommerce.com
|
92
93
|
licenses:
|
93
94
|
- BSD-3
|
@@ -98,18 +99,18 @@ require_paths:
|
|
98
99
|
- lib
|
99
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- -
|
102
|
+
- - ! '>='
|
102
103
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
104
|
+
version: 1.9.3
|
104
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
106
|
requirements:
|
106
|
-
- -
|
107
|
+
- - ! '>'
|
107
108
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
109
|
+
version: 1.3.1
|
109
110
|
requirements:
|
110
111
|
- none
|
111
112
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.0.3
|
113
114
|
signing_key:
|
114
115
|
specification_version: 4
|
115
116
|
summary: Sample data (including images) for use with Spree.
|