solidus_core 1.3.0 → 1.3.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.

Potentially problematic release.


This version of solidus_core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e46ab6204fe773f2c5a9eca4e58848739f4a4086
4
- data.tar.gz: 5cf71d6898cf7b9990fda8396cb07f609d883267
3
+ metadata.gz: 4c7402622fc30f6fef2fc3cad846e07adaeac3bf
4
+ data.tar.gz: 808c7fc752dbe3298afc6131a49509df4086202d
5
5
  SHA512:
6
- metadata.gz: 97f2fa3bd1d807f5310878b3eb08b3718bd53c896e09dcc533362a89c7ab2f6eae4e61eb864669b3a22a547e6e0f74338f2bab12f02a3ccb22ee03e4d49caf2e
7
- data.tar.gz: db37f8907d4d04c010a26253ffca83494c440bca20d4c32d0c6a7e481ac65f77c0cb20956ca6ca6708d4f11d0f681f4b00d887ba892b263c161f1447bf72cbca
6
+ metadata.gz: ff019cdef35791c28148b68397ac795b78ec86f2eed1d0d7cd33c34383b7bc5cd24342d79fe0e7c7fb95a3c77a3242df739419d821aca59ac6f5b5007d786250
7
+ data.tar.gz: ceabe9026cfb4469481120ab7ad9152fc02fe20e03435950f42b92149a3347eb64538d14d822760821204fd211830ad05b0a8afba6dbe76258bc454ec5f0f44b
@@ -5,7 +5,7 @@ module Spree
5
5
  end
6
6
 
7
7
  def self.solidus_version
8
- "1.3.0"
8
+ "1.3.1"
9
9
  end
10
10
 
11
11
  def self.solidus_gem_version
@@ -2,7 +2,6 @@ namespace :solidus do
2
2
  namespace :upgrade do
3
3
  desc "Upgrade Solidus to version 1.3"
4
4
  task one_point_three: [
5
- 'solidus:migrations:ensure_store_on_orders:up',
6
5
  'solidus:migrations:migrate_shipping_rate_taxes:up',
7
6
  'solidus:migrations:create_vat_prices:up'
8
7
  ] do
@@ -8,7 +8,6 @@ describe 'solidus:upgrade:one_point_three' do
8
8
  )
9
9
 
10
10
  before do
11
- load Spree::Core::Engine.root.join('lib/tasks/migrations/ensure_store_on_orders.rake')
12
11
  load Spree::Core::Engine.root.join('lib/tasks/migrations/migrate_shipping_rate_taxes.rake')
13
12
  load Spree::Core::Engine.root.join('lib/tasks/migrations/create_vat_prices.rake')
14
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -1054,7 +1054,6 @@ files:
1054
1054
  - lib/tasks/migrations/copy_order_bill_address_to_credit_card.rake
1055
1055
  - lib/tasks/migrations/copy_shipped_shipments_to_cartons.rake
1056
1056
  - lib/tasks/migrations/create_vat_prices.rake
1057
- - lib/tasks/migrations/ensure_store_on_orders.rake
1058
1057
  - lib/tasks/migrations/migrate_shipping_rate_taxes.rake
1059
1058
  - lib/tasks/migrations/migrate_user_addresses.rake
1060
1059
  - lib/tasks/order_capturing.rake
@@ -1159,7 +1158,6 @@ files:
1159
1158
  - spec/lib/tasks/exchanges_spec.rb
1160
1159
  - spec/lib/tasks/migrations/copy_shipped_shipments_to_cartons_spec.rb
1161
1160
  - spec/lib/tasks/migrations/create_vat_prices_spec.rb
1162
- - spec/lib/tasks/migrations/ensure_store_on_orders_spec.rb
1163
1161
  - spec/lib/tasks/migrations/migrate_shipping_rate_taxes_spec.rb
1164
1162
  - spec/lib/tasks/order_capturing_spec.rb
1165
1163
  - spec/lib/tasks/upgrade_spec.rb
@@ -1,38 +0,0 @@
1
- namespace :solidus do
2
- namespace :migrations do
3
- namespace :ensure_store_on_orders do
4
- desc "Makes sure every order in the system has a store attached"
5
- task up: :environment do
6
-
7
- attach_store_to_all_orders
8
- end
9
-
10
- def attach_store_to_all_orders
11
- orders_without_store_count = Spree::Order.where(store_id: nil).count
12
- if orders_without_store_count == 0
13
- puts "Everything is good, all orders in your database have a store attached."
14
- return
15
- end
16
-
17
- spree_store_count = Spree::Store.count
18
- if spree_store_count == 0
19
- raise "You do not have a store set up. Please create a store instance for your installation."
20
- elsif spree_store_count > 1
21
- raise(<<-TEXT.squish)
22
- You have more than one store set up. We can not be sure which store to attach your
23
- orders to. Please attach store ids to all your orders, and run this task again
24
- when you're finished.
25
- TEXT
26
- end
27
-
28
- default_store = Spree::Store.where(default: true).first
29
- unless default_store
30
- raise "Your store is not marked as default. Please mark your one store as the default store and run this task again."
31
- end
32
-
33
- Spree::Order.where(store_id: nil).update_all(store_id: Spree::Store.default.id)
34
- puts "All orders updated with the default store."
35
- end
36
- end
37
- end
38
- end
@@ -1,80 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'solidus:migrations:ensure_store_on_orders' do
4
- describe 'up' do
5
- include_context(
6
- 'rake',
7
- task_path: Spree::Core::Engine.root.join('lib/tasks/migrations/ensure_store_on_orders.rake'),
8
- task_name: 'solidus:migrations:ensure_store_on_orders:up',
9
- )
10
-
11
- context 'with no orders' do
12
- it 'succeeds' do
13
- expect { task.invoke }.to output(
14
- "Everything is good, all orders in your database have a store attached.\n"
15
- ).to_stdout
16
- end
17
- end
18
-
19
- context 'when all orders have store_ids' do
20
- let!(:order) { create(:order, store: create(:store)) }
21
-
22
- it 'succeeds' do
23
- expect { task.invoke }.to output(
24
- "Everything is good, all orders in your database have a store attached.\n"
25
- ).to_stdout
26
- end
27
- end
28
-
29
- context 'when some orders do not have store_ids' do
30
- let!(:order_with_store) { create(:order, store: store) }
31
- let!(:order_without_store) do
32
- # due to a before_validation that adds a store when one is missing,
33
- # we can't simply specify `store: nil`
34
- create(:order, store: store).tap do |o|
35
- o.update_columns(store_id: nil)
36
- end
37
- end
38
- let!(:store) { create(:store) }
39
-
40
- it 'succeeds' do
41
- expect { task.invoke }.to output(
42
- "All orders updated with the default store.\n"
43
- ).to_stdout
44
- end
45
-
46
- context 'when there are no stores' do
47
- before do
48
- order_with_store.update_columns(store_id: nil)
49
- # due to a before_validation that adds a store when one is missing,
50
- # we can't simply specify `store: nil`
51
- store.destroy
52
- end
53
-
54
- it 'raises' do
55
- expect { task.invoke }.to raise_error(/You do not have a store set up/)
56
- end
57
- end
58
-
59
- context 'when there are multiple stores' do
60
- let!(:extra_store) { create(:store) }
61
-
62
- it 'raises' do
63
- expect { task.invoke }.to raise_error(/You have more than one store set up/)
64
- end
65
- end
66
-
67
- context 'when there is no default store' do
68
- before do
69
- # The before_save 'ensure_default_exists_and_is_unique' means that we
70
- # need to use update_columns to set up this scenario.
71
- store.update_columns(default: false)
72
- end
73
-
74
- it 'raises' do
75
- expect { task.invoke }.to raise_error(/Your store is not marked as default/)
76
- end
77
- end
78
- end
79
- end
80
- end