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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3600d5a533290c099382476478e8eeb060d3596363939f726d1e02125e88aa1
4
- data.tar.gz: b3fa5cfb3f1e6f7a67bd3a893766292375b7b7217d21bd314666648b98a3615c
3
+ metadata.gz: c8422983aea32a3cdf481647862a2ada3210d21c38936c0d0af370772bc04b4d
4
+ data.tar.gz: 6fb241fe0339fce0747a496366f449f69671d90c0a69cd9483ccd1b0229ce7c0
5
5
  SHA512:
6
- metadata.gz: 318e5325ee20610090fbd4113ecd6bc3493b36f690ad4650b6186144f0615558be34279f779454d59b5a2089b3c672c37b9b65b9cd1ec85022ed26d184f755cf
7
- data.tar.gz: 7b072c3828d8a943f34eb9182e17923b4475014550583d7515d65458a7fe1db8778589654659526048456b29e2be80ca637c6f86fe5dd88c92cc35b1d9d86f68
6
+ metadata.gz: 5ca4af53faa281166a5a0f345d60a628e96dadbfce58a30d4948a63a21dc7386009d4b2a7c88521dc9979a61d8ac1adc4741e70168cc689e70b7b6f0deeb5368
7
+ data.tar.gz: 59ea38f49224546adf4bafc2720e6bd583b8823f3e4582c250c3fa949cc1a153479f2d969694f65a0b2e1d224e3c60595cfd0140e69c0e929db7d50a039b679d
@@ -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, (user.try(:available_store_credit_total, currency: currency) || 0.0)].min
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 (error || ineligible_for_this_order)
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).each do |return_item|
15
+ reimbursement.return_items.includes(:inventory_unit).find_each do |return_item|
16
16
  set_tax!(return_item)
17
17
  end
18
18
  end
@@ -24,7 +24,7 @@ module Spree
24
24
 
25
25
  def hash_to_packages(categories)
26
26
  packages = []
27
- categories.each do |_id, contents|
27
+ categories.each_value do |contents|
28
28
  packages << build_package(contents)
29
29
  end
30
30
  packages
@@ -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).each do |stock_location|
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
@@ -397,7 +397,7 @@ module Spree
397
397
  end
398
398
 
399
399
  def create_stock_items
400
- StockLocation.where(propagate_all_variants: true).each do |stock_location|
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
@@ -9,7 +9,7 @@ def create_states(subregions, country)
9
9
  end
10
10
 
11
11
  ActiveRecord::Base.transaction do
12
- Spree::Country.all.each do |country|
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.each do |update_reason|
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.each do |store_credit_reason|
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.each do |promotion|
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
@@ -44,6 +44,7 @@ module Spree
44
44
  opts[:skip_yarn] = true
45
45
  opts[:skip_bootsnap] = true
46
46
  opts[:skip_javascript] = true
47
+ opts[:skip_action_cable] = true
47
48
 
48
49
  puts "Generating dummy Rails application..."
49
50
  invoke Rails::Generators::AppGenerator,
@@ -3,7 +3,7 @@
3
3
  'mysql'
4
4
  when 'postgres', 'postgresql'
5
5
  'postgres'
6
- when 'sqlite', '', nil
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 ENV['DB']
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).each do |order|
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
- order.state = order.state
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,
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "4.1.3"
4
+ VERSION = "4.1.5"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION
data/lib/spree/money.rb CHANGED
@@ -35,7 +35,7 @@ module Spree
35
35
  if amount.is_a?(::Money)
36
36
  @money = amount
37
37
  else
38
- currency = (options[:currency] || Spree::Config[:currency])
38
+ currency = options[:currency] || Spree::Config[:currency]
39
39
 
40
40
  @money = Monetize.from_string(amount, currency)
41
41
  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: 4.1.3
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: 2023-11-02 00:00:00.000000000 Z
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.17
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.