spree_core 3.1.0.rc3 → 3.1.0.rc4
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/order.rb +2 -2
- data/app/models/spree/order_updater.rb +1 -0
- data/app/models/spree/stock_item.rb +1 -0
- data/config/locales/en.yml +4 -1
- data/lib/spree/core/engine.rb +6 -0
- data/lib/spree/core/version.rb +1 -1
- data/spec/models/spree/order_updater_spec.rb +43 -32
- data/spree_core.gemspec +2 -2
- metadata +6 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cb7bbd6bde30953cc5391ee02b054f23ca0b9b9
|
4
|
+
data.tar.gz: b9824021ae30dabf0f658a412bdcb8b37a76ebbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e993ddd8cd1329cf5a7925c4cea0ac14a33c7a8cabc75b2ee6c0793502e4d8d759e2f94a92d4c100c34ef6408ff073f9df5205df23356afdbb2249a9e548edf6
|
7
|
+
data.tar.gz: c7f741a6505e5d5c15ff12f08afdc137aa8b3f8cfde04541b834e6bcb782a750257ac2463c2da5d74994fc8abf194d9683867fbb7bd8dba9875a9555ee1ec614
|
data/app/models/spree/order.rb
CHANGED
@@ -3,8 +3,8 @@ require 'spree/order/checkout'
|
|
3
3
|
|
4
4
|
module Spree
|
5
5
|
class Order < Spree::Base
|
6
|
-
PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
|
7
|
-
SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped)
|
6
|
+
PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
|
7
|
+
SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped)
|
8
8
|
|
9
9
|
extend FriendlyId
|
10
10
|
friendly_id :number, slug_column: :number, use: :slugged
|
@@ -21,6 +21,7 @@ module Spree
|
|
21
21
|
|
22
22
|
after_save :conditional_variant_touch, if: :changed?
|
23
23
|
after_touch { variant.touch }
|
24
|
+
after_destroy { variant.touch }
|
24
25
|
|
25
26
|
self.whitelisted_ransackable_attributes = ['count_on_hand', 'stock_location_id']
|
26
27
|
self.whitelisted_ransackable_associations = ['variant']
|
data/config/locales/en.yml
CHANGED
@@ -439,6 +439,7 @@ en:
|
|
439
439
|
address: Address
|
440
440
|
address1: Address
|
441
441
|
address2: Address (contd.)
|
442
|
+
addresses: Addresses
|
442
443
|
adjustable: Adjustable
|
443
444
|
adjustment: Adjustment
|
444
445
|
adjustment_amount: Amount
|
@@ -1352,7 +1353,7 @@ en:
|
|
1352
1353
|
apply: Apply Store Credit
|
1353
1354
|
applicable_amount: "%{amount} in store credit will be applied to this order."
|
1354
1355
|
available_amount: "You have %{amount} in Store Credit available!"
|
1355
|
-
remaining_amount: "You have %{amount} remaining in your account
|
1356
|
+
remaining_amount: "You have %{amount} remaining in your account's Store Credit."
|
1356
1357
|
additional_payment_needed: Select another payment method for the remaining %{amount}.
|
1357
1358
|
errors:
|
1358
1359
|
cannot_change_used_store_credit: You cannot change a store credit that has already been used
|
@@ -1393,6 +1394,8 @@ en:
|
|
1393
1394
|
taxon: Taxon
|
1394
1395
|
taxon_edit: Edit Taxon
|
1395
1396
|
taxon_placeholder: Add a Taxon
|
1397
|
+
tags: Tags
|
1398
|
+
tags_placeholder: Add Tags
|
1396
1399
|
taxon_rule:
|
1397
1400
|
choose_taxons: Choose taxons
|
1398
1401
|
label: Order must contain x amount of these taxons
|
data/lib/spree/core/engine.rb
CHANGED
@@ -115,6 +115,12 @@ module Spree
|
|
115
115
|
end
|
116
116
|
|
117
117
|
config.to_prepare do
|
118
|
+
# Load spree locales before decorators
|
119
|
+
I18n.load_path += Dir.glob(
|
120
|
+
File.join(
|
121
|
+
File.dirname(__FILE__), '../../../config/locales', '*.{rb,yml}'
|
122
|
+
)
|
123
|
+
)
|
118
124
|
# Load application's model / class decorators
|
119
125
|
Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
|
120
126
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
data/lib/spree/core/version.rb
CHANGED
@@ -210,45 +210,56 @@ module Spree
|
|
210
210
|
context "completed order" do
|
211
211
|
before { allow(order).to receive_messages completed?: true }
|
212
212
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
it "updates shipment state" do
|
219
|
-
expect(updater).to receive(:update_shipment_state)
|
220
|
-
updater.update
|
221
|
-
end
|
213
|
+
describe "#update" do
|
214
|
+
it "updates payment state" do
|
215
|
+
expect(updater).to receive(:update_payment_state)
|
216
|
+
updater.update
|
217
|
+
end
|
222
218
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
allow(shipments).to receive_messages states: []
|
228
|
-
allow(shipments).to receive_messages ready: []
|
229
|
-
allow(shipments).to receive_messages pending: []
|
230
|
-
allow(shipments).to receive_messages shipped: []
|
219
|
+
it "updates shipment state" do
|
220
|
+
expect(updater).to receive(:update_shipment_state)
|
221
|
+
updater.update
|
222
|
+
end
|
231
223
|
|
232
|
-
|
233
|
-
|
224
|
+
it "updates shipments total again after updating shipments" do
|
225
|
+
expect(updater).to receive(:update_shipment_total).ordered
|
226
|
+
expect(updater).to receive(:update_shipments).ordered
|
227
|
+
expect(updater).to receive(:update_shipment_total).ordered
|
228
|
+
updater.update
|
229
|
+
end
|
234
230
|
end
|
235
231
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
232
|
+
describe "#update_shipments" do
|
233
|
+
it "updates each shipment" do
|
234
|
+
shipment = stub_model(Spree::Shipment, order: order)
|
235
|
+
shipments = [shipment]
|
236
|
+
allow(order).to receive_messages shipments: shipments
|
237
|
+
allow(shipments).to receive_messages states: []
|
238
|
+
allow(shipments).to receive_messages ready: []
|
239
|
+
allow(shipments).to receive_messages pending: []
|
240
|
+
allow(shipments).to receive_messages shipped: []
|
241
|
+
|
242
|
+
expect(shipment).to receive(:update!).with(order)
|
243
|
+
updater.update_shipments
|
244
|
+
end
|
240
245
|
|
241
|
-
|
242
|
-
|
243
|
-
|
246
|
+
it "refreshes shipment rates" do
|
247
|
+
shipment = stub_model(Spree::Shipment, order: order)
|
248
|
+
shipments = [shipment]
|
249
|
+
allow(order).to receive_messages shipments: shipments
|
244
250
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
251
|
+
expect(shipment).to receive(:refresh_rates)
|
252
|
+
updater.update_shipments
|
253
|
+
end
|
254
|
+
|
255
|
+
it "updates the shipment amount" do
|
256
|
+
shipment = stub_model(Spree::Shipment, order: order)
|
257
|
+
shipments = [shipment]
|
258
|
+
allow(order).to receive_messages shipments: shipments
|
249
259
|
|
250
|
-
|
251
|
-
|
260
|
+
expect(shipment).to receive(:update_amounts)
|
261
|
+
updater.update_shipments
|
262
|
+
end
|
252
263
|
end
|
253
264
|
end
|
254
265
|
|
data/spree_core.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.files = `git ls-files`.split("\n")
|
20
20
|
s.require_path = 'lib'
|
21
21
|
|
22
|
-
s.add_dependency 'activemerchant', '~> 1.
|
22
|
+
s.add_dependency 'activemerchant', '~> 1.49.0'
|
23
23
|
s.add_dependency 'acts_as_list', '0.7.2'
|
24
24
|
s.add_dependency 'awesome_nested_set', '~> 3.0.1'
|
25
25
|
s.add_dependency 'carmen', '~> 1.0.0'
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_dependency 'font-awesome-rails', '~> 4.0'
|
30
30
|
s.add_dependency 'friendly_id', '~> 5.1.0'
|
31
31
|
s.add_dependency 'highline', '~> 1.6.18' # Necessary for the install generator
|
32
|
-
s.add_dependency 'kaminari', '~> 0.
|
32
|
+
s.add_dependency 'kaminari', '~> 0.17'
|
33
33
|
s.add_dependency 'monetize', '~> 1.1'
|
34
34
|
s.add_dependency 'paperclip', '~> 4.3.0'
|
35
35
|
s.add_dependency 'paranoia', '~> 2.1.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0.
|
4
|
+
version: 3.1.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.49.0
|
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: 1.
|
26
|
+
version: 1.49.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: acts_as_list
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,20 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '0.
|
160
|
-
- - ">="
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: 0.15.1
|
159
|
+
version: '0.17'
|
163
160
|
type: :runtime
|
164
161
|
prerelease: false
|
165
162
|
version_requirements: !ruby/object:Gem::Requirement
|
166
163
|
requirements:
|
167
164
|
- - "~>"
|
168
165
|
- !ruby/object:Gem::Version
|
169
|
-
version: '0.
|
170
|
-
- - ">="
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: 0.15.1
|
166
|
+
version: '0.17'
|
173
167
|
- !ruby/object:Gem::Dependency
|
174
168
|
name: monetize
|
175
169
|
requirement: !ruby/object:Gem::Requirement
|