solidus_core 4.1.3 → 4.1.5
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/order.rb +1 -1
- data/app/models/spree/promotion_handler/coupon.rb +1 -1
- data/app/models/spree/reimbursement_tax_calculator.rb +1 -1
- data/app/models/spree/stock/splitter/shipping_category.rb +1 -1
- data/app/models/spree/stock_location.rb +1 -1
- data/app/models/spree/variant.rb +1 -1
- data/db/default/spree/states.rb +1 -1
- data/db/migrate/20180710170104_create_spree_store_credit_reasons_table.rb +2 -2
- data/db/migrate/20220317165036_set_promotions_with_any_policy_to_all_if_possible.rb +1 -1
- data/lib/generators/spree/dummy/dummy_generator.rb +1 -0
- data/lib/generators/spree/dummy/templates/rails/database.yml +2 -2
- data/lib/spree/app_configuration.rb +2 -0
- data/lib/spree/core/controller_helpers/order.rb +1 -1
- data/lib/spree/core/state_machines/order.rb +5 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/money.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8422983aea32a3cdf481647862a2ada3210d21c38936c0d0af370772bc04b4d
|
4
|
+
data.tar.gz: 6fb241fe0339fce0747a496366f449f69671d90c0a69cd9483ccd1b0229ce7c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca4af53faa281166a5a0f345d60a628e96dadbfce58a30d4948a63a21dc7386009d4b2a7c88521dc9979a61d8ac1adc4741e70168cc689e70b7b6f0deeb5368
|
7
|
+
data.tar.gz: 59ea38f49224546adf4bafc2720e6bd583b8823f3e4582c250c3fa949cc1a153479f2d969694f65a0b2e1d224e3c60595cfd0140e69c0e929db7d50a039b679d
|
data/app/models/spree/order.rb
CHANGED
@@ -630,7 +630,7 @@ module Spree
|
|
630
630
|
if can_complete? || complete?
|
631
631
|
valid_store_credit_payments.to_a.sum(&:amount)
|
632
632
|
else
|
633
|
-
[total,
|
633
|
+
[total, user.try(:available_store_credit_total, currency: currency) || 0.0].min
|
634
634
|
end
|
635
635
|
end
|
636
636
|
|
@@ -73,7 +73,7 @@ module Spree
|
|
73
73
|
|
74
74
|
unless promotion.eligible?(order, promotion_code: promotion_code)
|
75
75
|
set_promotion_eligibility_error_code(promotion)
|
76
|
-
return
|
76
|
+
return error || ineligible_for_this_order
|
77
77
|
end
|
78
78
|
|
79
79
|
# If any of the actions for the promotion return `true`,
|
@@ -12,7 +12,7 @@ module Spree
|
|
12
12
|
class ReimbursementTaxCalculator
|
13
13
|
class << self
|
14
14
|
def call(reimbursement)
|
15
|
-
reimbursement.return_items.includes(:inventory_unit).
|
15
|
+
reimbursement.return_items.includes(:inventory_unit).find_each do |return_item|
|
16
16
|
set_tax!(return_item)
|
17
17
|
end
|
18
18
|
end
|
@@ -121,7 +121,7 @@ module Spree
|
|
121
121
|
|
122
122
|
def ensure_one_default
|
123
123
|
if default
|
124
|
-
Spree::StockLocation.where(default: true).where.not(id: id).
|
124
|
+
Spree::StockLocation.where(default: true).where.not(id: id).find_each do |stock_location|
|
125
125
|
stock_location.default = false
|
126
126
|
stock_location.save!
|
127
127
|
end
|
data/app/models/spree/variant.rb
CHANGED
@@ -397,7 +397,7 @@ module Spree
|
|
397
397
|
end
|
398
398
|
|
399
399
|
def create_stock_items
|
400
|
-
StockLocation.where(propagate_all_variants: true).
|
400
|
+
StockLocation.where(propagate_all_variants: true).find_each do |stock_location|
|
401
401
|
stock_location.propagate_variant(self)
|
402
402
|
end
|
403
403
|
end
|
data/db/default/spree/states.rb
CHANGED
@@ -9,7 +9,7 @@ def create_states(subregions, country)
|
|
9
9
|
end
|
10
10
|
|
11
11
|
ActiveRecord::Base.transaction do
|
12
|
-
Spree::Country.all.
|
12
|
+
Spree::Country.all.find_each do |country|
|
13
13
|
carmen_country = Carmen::Country.coded(country.iso)
|
14
14
|
next unless carmen_country.subregions?
|
15
15
|
|
@@ -17,7 +17,7 @@ class CreateSpreeStoreCreditReasonsTable < ActiveRecord::Migration[5.1]
|
|
17
17
|
t.timestamps
|
18
18
|
end
|
19
19
|
|
20
|
-
StoreCreditUpdateReason.all.
|
20
|
+
StoreCreditUpdateReason.all.find_each do |update_reason|
|
21
21
|
StoreCreditReason.create!(name: update_reason.name)
|
22
22
|
end
|
23
23
|
|
@@ -45,7 +45,7 @@ class CreateSpreeStoreCreditReasonsTable < ActiveRecord::Migration[5.1]
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
StoreCreditReason.all.
|
48
|
+
StoreCreditReason.all.find_each do |store_credit_reason|
|
49
49
|
StoreCreditUpdateReason.create!(name: store_credit_reason.name)
|
50
50
|
end
|
51
51
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class SetPromotionsWithAnyPolicyToAllIfPossible < ActiveRecord::Migration[5.2]
|
4
4
|
def up
|
5
|
-
Spree::Promotion.where(match_policy: :any).includes(:promotion_rules).all.
|
5
|
+
Spree::Promotion.where(match_policy: :any).includes(:promotion_rules).all.find_each do |promotion|
|
6
6
|
if promotion.promotion_rules.length <= 1
|
7
7
|
promotion.update!(match_policy: :all)
|
8
8
|
else
|
@@ -3,7 +3,7 @@
|
|
3
3
|
'mysql'
|
4
4
|
when 'postgres', 'postgresql'
|
5
5
|
'postgres'
|
6
|
-
when
|
6
|
+
when /sqlite3?/, '', nil
|
7
7
|
'sqlite'
|
8
8
|
else
|
9
9
|
raise "Invalid DB specified: #{ENV['DB']}"
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<% db_username = ENV['DB_USERNAME'] %>
|
20
20
|
<% db_password = ENV['DB_PASSWORD'] %>
|
21
21
|
|
22
|
-
<% case
|
22
|
+
<% case db
|
23
23
|
when 'mysql' %>
|
24
24
|
development:
|
25
25
|
adapter: mysql2
|
@@ -22,6 +22,8 @@ require "spree/core/search/variant"
|
|
22
22
|
require 'spree/preferences/configuration'
|
23
23
|
require 'spree/core/environment'
|
24
24
|
|
25
|
+
require 'uri'
|
26
|
+
|
25
27
|
module Spree
|
26
28
|
class AppConfiguration < Preferences::Configuration
|
27
29
|
# Preferences (alphabetized to more easily lookup particular preferences)
|
@@ -45,7 +45,7 @@ module Spree
|
|
45
45
|
|
46
46
|
def set_current_order
|
47
47
|
if spree_current_user && current_order
|
48
|
-
spree_current_user.orders.by_store(current_store).incomplete.where('id != ?', current_order.id).
|
48
|
+
spree_current_user.orders.by_store(current_store).incomplete.where('id != ?', current_order.id).find_each do |order|
|
49
49
|
current_order.merge!(order, spree_current_user)
|
50
50
|
end
|
51
51
|
end
|
@@ -46,7 +46,11 @@ module Spree
|
|
46
46
|
|
47
47
|
# Persist the state on the order
|
48
48
|
after_transition do |order, transition|
|
49
|
-
|
49
|
+
# Hard to say if this is really necessary, it was introduced in this commit:
|
50
|
+
# https://github.com/mamhoff/solidus/commit/fa1d66c42e4c04ee7cd1c20d87e4cdb74a226d3d
|
51
|
+
# But it seems to be harmless, so we'll keep it for now.
|
52
|
+
order.state = order.state # rubocop:disable Lint/SelfAssignment
|
53
|
+
|
50
54
|
order.state_changes.create(
|
51
55
|
previous_state: transition.from,
|
52
56
|
next_state: transition.to,
|
data/lib/spree/core/version.rb
CHANGED
data/lib/spree/money.rb
CHANGED
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: 4.1.
|
4
|
+
version: 4.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|
@@ -1047,7 +1047,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1047
1047
|
- !ruby/object:Gem::Version
|
1048
1048
|
version: 1.8.23
|
1049
1049
|
requirements: []
|
1050
|
-
rubygems_version: 3.4.
|
1050
|
+
rubygems_version: 3.4.19
|
1051
1051
|
signing_key:
|
1052
1052
|
specification_version: 4
|
1053
1053
|
summary: Essential models, mailers, and classes for the Solidus e-commerce project.
|