spree_core 4.4.0.rc1 → 4.4.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/calculator.rb +1 -1
- data/app/models/spree/return_authorization.rb +1 -0
- data/app/models/spree/store_credit.rb +1 -1
- data/app/services/spree/seeds/store_credit_categories.rb +2 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support/metadata.rb +23 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6068db45525230da41ca606788cebd91ab374323e4e74497da8be61f0078d708
|
4
|
+
data.tar.gz: 0d2d9dd7d2f9e100e410a71704e231f97e4be1fe7ada6f468ceb783d9780bcac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db2b58e61632b424a69e058b882daef3713d05d39bd49d818432a3028eab14d8ee4817fa8ca94633b71c287cca77ef9b2ad40c959d34a1e978da5be1b0ad6a37
|
7
|
+
data.tar.gz: '08cc33ae6f5f6e8917d94b26831342bf9e7cc1db94db85923d1d01fd1c06ed323b983d64d90725697c42f938a952a0127799cf98b06937b74cb9416171dee0f6'
|
@@ -2,7 +2,7 @@ module Spree
|
|
2
2
|
class Calculator < Spree::Base
|
3
3
|
acts_as_paranoid
|
4
4
|
|
5
|
-
belongs_to :calculable, polymorphic: true, optional: true
|
5
|
+
belongs_to :calculable, polymorphic: true, optional: true, inverse_of: :calculator
|
6
6
|
|
7
7
|
# This method calls a compute_<computable> method. must be overridden in concrete calculator.
|
8
8
|
#
|
@@ -250,7 +250,7 @@ module Spree
|
|
250
250
|
def associate_credit_type
|
251
251
|
unless type_id
|
252
252
|
credit_type_name = category.try(:non_expiring?) ? 'Non-expiring' : 'Expiring'
|
253
|
-
self.credit_type = Spree::StoreCreditType.
|
253
|
+
self.credit_type = Spree::StoreCreditType.find_or_create_by(name: credit_type_name)
|
254
254
|
end
|
255
255
|
end
|
256
256
|
end
|
@@ -6,6 +6,8 @@ module Spree
|
|
6
6
|
def call
|
7
7
|
# FIXME: we should use translations here
|
8
8
|
Spree::StoreCreditCategory.find_or_create_by!(name: 'Default')
|
9
|
+
Spree::StoreCreditCategory.find_or_create_by!(name: 'Non-expiring')
|
10
|
+
Spree::StoreCreditCategory.find_or_create_by!(name: 'Expiring')
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
data/lib/spree/core/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
shared_examples_for 'metadata' do |factory: described_class.name.demodulize.underscore.to_sym|
|
2
|
+
subject { FactoryBot.create(factory) }
|
3
|
+
|
4
|
+
it { expect(subject.has_attribute?(:public_metadata)).to be_truthy }
|
5
|
+
it { expect(subject.has_attribute?(:private_metadata)).to be_truthy }
|
6
|
+
|
7
|
+
it { expect(subject.public_metadata.class).to eq(HashWithIndifferentAccess) }
|
8
|
+
it { expect(subject.private_metadata.class).to eq(HashWithIndifferentAccess) }
|
9
|
+
|
10
|
+
it do
|
11
|
+
string = subject.public_metadata[:color] = 'red'
|
12
|
+
number = subject.public_metadata[:priority] = 1
|
13
|
+
array = subject.public_metadata[:keywords] = ['k1', 'k2']
|
14
|
+
hash = subject.public_metadata[:additional_data] = { size: 'big', material: 'wool' }
|
15
|
+
|
16
|
+
subject.save!
|
17
|
+
|
18
|
+
expect(subject.public_metadata[:color]).to eq(string)
|
19
|
+
expect(subject.public_metadata[:priority]).to eq(number)
|
20
|
+
expect(subject.public_metadata[:keywords]).to eq(array)
|
21
|
+
expect(subject.public_metadata[:additional_data]).to eq(hash.stringify_keys)
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.0.
|
4
|
+
version: 4.4.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -954,6 +954,7 @@ files:
|
|
954
954
|
- lib/spree/testing_support/jobs.rb
|
955
955
|
- lib/spree/testing_support/kernel.rb
|
956
956
|
- lib/spree/testing_support/locale_helpers.rb
|
957
|
+
- lib/spree/testing_support/metadata.rb
|
957
958
|
- lib/spree/testing_support/next_instance_of.rb
|
958
959
|
- lib/spree/testing_support/order_walkthrough.rb
|
959
960
|
- lib/spree/testing_support/preferences.rb
|
@@ -976,9 +977,9 @@ licenses:
|
|
976
977
|
- BSD-3-Clause
|
977
978
|
metadata:
|
978
979
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
979
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.4.0.
|
980
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.4.0.rc2
|
980
981
|
documentation_uri: https://dev-docs.spreecommerce.org/
|
981
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.4.0.
|
982
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.4.0.rc2
|
982
983
|
post_install_message:
|
983
984
|
rdoc_options: []
|
984
985
|
require_paths:
|
@@ -994,7 +995,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
994
995
|
- !ruby/object:Gem::Version
|
995
996
|
version: 1.8.23
|
996
997
|
requirements: []
|
997
|
-
rubygems_version: 3.2.
|
998
|
+
rubygems_version: 3.2.32
|
998
999
|
signing_key:
|
999
1000
|
specification_version: 4
|
1000
1001
|
summary: The bare bones necessary for Spree
|