solidus_core 2.11.2 → 2.11.7

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.

Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/spree/address.rb +28 -5
  3. data/app/models/spree/base.rb +9 -2
  4. data/app/models/spree/calculator.rb +4 -4
  5. data/app/models/spree/calculator/free_shipping.rb +1 -0
  6. data/app/models/spree/calculator/percent_per_item.rb +2 -0
  7. data/app/models/spree/calculator/price_sack.rb +1 -0
  8. data/app/models/spree/order/payments.rb +2 -2
  9. data/app/models/spree/order_merger.rb +1 -1
  10. data/app/models/spree/payment.rb +10 -3
  11. data/app/models/spree/payment/cancellation.rb +3 -22
  12. data/app/models/spree/payment_source.rb +2 -2
  13. data/app/models/spree/product.rb +8 -2
  14. data/app/models/spree/product/scopes.rb +0 -1
  15. data/app/models/spree/shipping_method.rb +1 -1
  16. data/app/models/spree/stock/availability_validator.rb +2 -2
  17. data/app/models/spree/stock/inventory_validator.rb +2 -2
  18. data/app/models/spree/taxon/active_storage_attachment.rb +1 -2
  19. data/app/models/spree/taxon/paperclip_attachment.rb +1 -0
  20. data/db/migrate/20180416083007_add_apply_to_all_to_variant_property_rule.rb +1 -1
  21. data/db/migrate/20210122110141_add_name_to_spree_addresses.rb +13 -0
  22. data/lib/generators/spree/dummy/templates/rails/test.rb +4 -1
  23. data/lib/spree/app_configuration.rb +1 -1
  24. data/lib/spree/core.rb +1 -4
  25. data/lib/spree/core/engine.rb +7 -8
  26. data/lib/spree/core/version.rb +1 -1
  27. data/lib/spree/permitted_attributes.rb +5 -5
  28. data/lib/spree/testing_support.rb +31 -0
  29. data/lib/spree/testing_support/dummy_app.rb +4 -2
  30. data/lib/spree/testing_support/dummy_app/mailer_previews/test_mailer_preview.rb +4 -0
  31. data/lib/spree/testing_support/factories.rb +8 -4
  32. data/lib/spree/testing_support/factories/address_factory.rb +6 -2
  33. data/lib/spree/testing_support/factories/adjustment_factory.rb +10 -5
  34. data/lib/spree/testing_support/factories/adjustment_reason_factory.rb +5 -0
  35. data/lib/spree/testing_support/factories/calculator_factory.rb +5 -0
  36. data/lib/spree/testing_support/factories/carton_factory.rb +7 -2
  37. data/lib/spree/testing_support/factories/country_factory.rb +5 -0
  38. data/lib/spree/testing_support/factories/credit_card_factory.rb +5 -0
  39. data/lib/spree/testing_support/factories/customer_return_factory.rb +8 -3
  40. data/lib/spree/testing_support/factories/image_factory.rb +5 -0
  41. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +9 -4
  42. data/lib/spree/testing_support/factories/line_item_factory.rb +7 -2
  43. data/lib/spree/testing_support/factories/option_type_factory.rb +8 -0
  44. data/lib/spree/testing_support/factories/option_value_factory.rb +5 -0
  45. data/lib/spree/testing_support/factories/order_factory.rb +11 -6
  46. data/lib/spree/testing_support/factories/order_promotion_factory.rb +7 -2
  47. data/lib/spree/testing_support/factories/payment_factory.rb +9 -4
  48. data/lib/spree/testing_support/factories/payment_method_factory.rb +5 -0
  49. data/lib/spree/testing_support/factories/price_factory.rb +6 -1
  50. data/lib/spree/testing_support/factories/product_factory.rb +10 -5
  51. data/lib/spree/testing_support/factories/product_option_type_factory.rb +7 -2
  52. data/lib/spree/testing_support/factories/product_property_factory.rb +7 -2
  53. data/lib/spree/testing_support/factories/promotion_category_factory.rb +5 -0
  54. data/lib/spree/testing_support/factories/promotion_code_factory.rb +7 -2
  55. data/lib/spree/testing_support/factories/promotion_factory.rb +7 -2
  56. data/lib/spree/testing_support/factories/property_factory.rb +5 -0
  57. data/lib/spree/testing_support/factories/refund_factory.rb +7 -2
  58. data/lib/spree/testing_support/factories/refund_reason_factory.rb +5 -0
  59. data/lib/spree/testing_support/factories/reimbursement_factory.rb +6 -1
  60. data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +5 -0
  61. data/lib/spree/testing_support/factories/return_authorization_factory.rb +8 -3
  62. data/lib/spree/testing_support/factories/return_item_factory.rb +8 -3
  63. data/lib/spree/testing_support/factories/return_reason_factory.rb +5 -0
  64. data/lib/spree/testing_support/factories/role_factory.rb +5 -0
  65. data/lib/spree/testing_support/factories/shipment_factory.rb +9 -3
  66. data/lib/spree/testing_support/factories/shipping_category_factory.rb +5 -0
  67. data/lib/spree/testing_support/factories/shipping_method_factory.rb +8 -3
  68. data/lib/spree/testing_support/factories/shipping_rate_factory.rb +7 -2
  69. data/lib/spree/testing_support/factories/state_factory.rb +7 -1
  70. data/lib/spree/testing_support/factories/stock_item_factory.rb +7 -2
  71. data/lib/spree/testing_support/factories/stock_location_factory.rb +8 -3
  72. data/lib/spree/testing_support/factories/stock_movement_factory.rb +6 -1
  73. data/lib/spree/testing_support/factories/stock_package_factory.rb +7 -2
  74. data/lib/spree/testing_support/factories/store_credit_category_factory.rb +5 -0
  75. data/lib/spree/testing_support/factories/store_credit_event_factory.rb +7 -2
  76. data/lib/spree/testing_support/factories/store_credit_factory.rb +8 -3
  77. data/lib/spree/testing_support/factories/store_credit_reason_factory.rb +5 -0
  78. data/lib/spree/testing_support/factories/store_credit_type_factory.rb +5 -0
  79. data/lib/spree/testing_support/factories/store_factory.rb +6 -1
  80. data/lib/spree/testing_support/factories/tax_category_factory.rb +7 -1
  81. data/lib/spree/testing_support/factories/tax_rate_factory.rb +8 -3
  82. data/lib/spree/testing_support/factories/taxon_factory.rb +6 -1
  83. data/lib/spree/testing_support/factories/taxonomy_factory.rb +5 -0
  84. data/lib/spree/testing_support/factories/user_factory.rb +8 -3
  85. data/lib/spree/testing_support/factories/variant_factory.rb +9 -4
  86. data/lib/spree/testing_support/factories/variant_property_rule_condition_factory.rb +7 -2
  87. data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +8 -3
  88. data/lib/spree/testing_support/factories/variant_property_rule_value_factory.rb +7 -2
  89. data/lib/spree/testing_support/factories/zone_factory.rb +7 -2
  90. data/lib/spree/testing_support/factory_bot.rb +68 -0
  91. data/lib/spree/testing_support/order_walkthrough.rb +10 -10
  92. data/lib/spree/testing_support/sequences.rb +4 -1
  93. data/{app/models → lib}/spree/user_class_handle.rb +0 -0
  94. data/lib/tasks/email.rake +3 -2
  95. data/lib/tasks/migrations/migrate_address_names.rake +158 -0
  96. data/lib/tasks/migrations/migrate_default_billing_addresses_to_address_book.rake +38 -0
  97. data/lib/tasks/upgrade.rake +13 -0
  98. data/solidus_core.gemspec +24 -2
  99. metadata +48 -23
  100. data/lib/spree/awesome_nested_set_override.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4088c7b936f5cf51c775833b1b1ae3d887768e0f984bdec298d4b5c7c55e4ee
4
- data.tar.gz: 23aca23474e10e7929f0a955d19014afc13fdf6f4e554ee23492111a245e8f4c
3
+ metadata.gz: f4d85b2e48b45c5f20a8de9e1152813de4731e283946bb69c1bef2c01b8b9455
4
+ data.tar.gz: 78b9982563a8722a9892313dc8c3a4f2631d291679cad631c482c13b25279090
5
5
  SHA512:
6
- metadata.gz: 7f382b90ff7c1cec3fd550e1cc3d6683a070c2c6360ce892d179e66292897b46be11e6b9d63811b831aeac2fb237d766aee8358f4a73b6971a704e599b7ae3f7
7
- data.tar.gz: 062ee4a9443aa6a5f2322a261f20ec2a0c291228094b15b82374eff18210e97984fc4c1527b003aa222cf391287e7fa86990f8026b2e6468b6631b89be32370e
6
+ metadata.gz: ae52ba5c560040d3e6096d129dafc377b59de4ac7a536728f28c5099846d727e511ae2604f72f47473117cdc25e6b69e3aa690aeecc3df9d57a66b592cd73b80
7
+ data.tar.gz: 2662be65dd3122d1f35bbd272b2b341ec4a54f123bde9acadb5145b726164a8bed4b4956d62c9577527ce9f130c040ffff0958bd576525c29eb7690d7bbf8ea6
@@ -92,6 +92,12 @@ module Spree
92
92
  if base['lastname'].presence || base['last_name'].presence
93
93
  base['lastname'] = name_from_attributes.last_name
94
94
  end
95
+
96
+ virtual_name = name_from_attributes.value
97
+ if base['name'].blank? && virtual_name.present?
98
+ base['name'] = virtual_name
99
+ end
100
+
95
101
  excluded_attributes = DB_ONLY_ATTRS + %w(first_name last_name)
96
102
 
97
103
  base.except(*excluded_attributes)
@@ -120,7 +126,11 @@ module Spree
120
126
  # @return [Boolean] true if the two addresses have the same address fields
121
127
  def ==(other_address)
122
128
  return false unless other_address && other_address.respond_to?(:value_attributes)
123
- value_attributes == other_address.value_attributes
129
+ if Spree::Config.use_combined_first_and_last_name_in_address
130
+ value_attributes.except(*LEGACY_NAME_ATTRS) == other_address.value_attributes.except(*LEGACY_NAME_ATTRS)
131
+ else
132
+ value_attributes == other_address.value_attributes
133
+ end
124
134
  end
125
135
 
126
136
  # @deprecated Do not use this. Use Address.== instead.
@@ -193,17 +203,30 @@ module Spree
193
203
  country && country.iso
194
204
  end
195
205
 
206
+ before_save :set_name_from_firstname_and_lastname
207
+
208
+ def set_name_from_firstname_and_lastname
209
+ name_from_firstname_and_lastname = Spree::Address::Name.from_attributes(attributes.except(:name, 'name'))
210
+
211
+ if read_attribute(:name).blank? && name_from_firstname_and_lastname.present?
212
+ write_attribute(:name, name_from_firstname_and_lastname)
213
+ end
214
+ end
215
+
196
216
  # @return [String] the full name on this address
197
217
  def name
198
- Spree::Address::Name.new(
199
- read_attribute(:firstname),
200
- read_attribute(:lastname)
201
- ).value
218
+ self[:name] || begin
219
+ Spree::Address::Name.new(
220
+ read_attribute(:firstname),
221
+ read_attribute(:lastname)
222
+ ).value
223
+ end
202
224
  end
203
225
 
204
226
  def name=(value)
205
227
  return if value.nil?
206
228
 
229
+ write_attribute(:name, value)
207
230
  name_from_value = Spree::Address::Name.new(value)
208
231
  write_attribute(:firstname, name_from_value.first_name)
209
232
  write_attribute(:lastname, name_from_value.last_name)
@@ -3,10 +3,12 @@
3
3
  class Spree::Base < ActiveRecord::Base
4
4
  include Spree::Preferences::Preferable
5
5
  include Spree::Core::Permalinks
6
- serialize :preferences, Hash
7
-
8
6
  include Spree::RansackableAttributes
9
7
 
8
+ def preferences
9
+ read_attribute(:preferences) || self.class.preferences_coder_class.new
10
+ end
11
+
10
12
  def initialize_preference_defaults
11
13
  if has_attribute?(:preferences)
12
14
  self.preferences = default_preferences.merge(preferences)
@@ -18,6 +20,7 @@ class Spree::Base < ActiveRecord::Base
18
20
  def self.preference(*args)
19
21
  # after_initialize can be called multiple times with the same symbol, it
20
22
  # will only be called once on initialization.
23
+ serialize :preferences, preferences_coder_class
21
24
  after_initialize :initialize_preference_defaults
22
25
  super
23
26
  end
@@ -32,6 +35,10 @@ class Spree::Base < ActiveRecord::Base
32
35
  end
33
36
  end
34
37
 
38
+ def self.preferences_coder_class
39
+ Hash
40
+ end
41
+
35
42
  self.abstract_class = true
36
43
 
37
44
  # Provides a scope that should be included any time products
@@ -10,12 +10,12 @@ module Spree
10
10
  def compute(computable)
11
11
  # Spree::LineItem -> :compute_line_item
12
12
  computable_name = computable.class.name.demodulize.underscore
13
- method = "compute_#{computable_name}".to_sym
13
+ method_name = "compute_#{computable_name}".to_sym
14
14
  calculator_class = self.class
15
- if respond_to?(method)
16
- send(method, computable)
15
+ if respond_to?(method_name)
16
+ send(method_name, computable)
17
17
  else
18
- raise NotImplementedError, "Please implement '#{method}(#{computable_name})' in your calculator: #{calculator_class.name}"
18
+ raise NotImplementedError, "Please implement '#{method_name}(#{computable_name})' in your calculator: #{calculator_class.name}"
19
19
  end
20
20
  end
21
21
 
@@ -8,6 +8,7 @@ module Spree
8
8
  # now a Promotion Action which deals with these types of promotions instead.
9
9
  class Calculator::FreeShipping < Calculator
10
10
  def compute(object)
11
+ Spree::Deprecation.warn('This method is deprecated, because it is no longer used')
11
12
  if object.is_a?(Array)
12
13
  return if object.empty?
13
14
  order = object.first.order
@@ -15,6 +15,8 @@ module Spree
15
15
  preference :percent, :decimal, default: 0
16
16
 
17
17
  def compute(object = nil)
18
+ Spree::Deprecation.warn('This method is deprecated, please use adjustments at line item level')
19
+
18
20
  return 0 if object.nil?
19
21
  object.line_items.sum { |line_item|
20
22
  value_for_line_item(line_item)
@@ -11,6 +11,7 @@ module Spree
11
11
 
12
12
  # as object we always get line items, as calculable we have Coupon, ShippingMethod
13
13
  def compute(object)
14
+ Spree::Deprecation.warn('This method is deprecated, please use adjustments at line item level')
14
15
  if object.is_a?(Array)
15
16
  base = object.sum { |element| element.respond_to?(:amount) ? element.amount : BigDecimal(element.to_s) }
16
17
  else
@@ -37,14 +37,14 @@ module Spree
37
37
 
38
38
  private
39
39
 
40
- def process_payments_with(method)
40
+ def process_payments_with(method_name)
41
41
  # Don't run if there is nothing to pay.
42
42
  return true if payment_total >= total
43
43
 
44
44
  unprocessed_payments.each do |payment|
45
45
  break if payment_total >= total
46
46
 
47
- payment.public_send(method)
47
+ payment.public_send(method_name)
48
48
  end
49
49
  rescue Core::GatewayError => error
50
50
  result = !!Spree::Config[:allow_checkout_on_gateway_error]
@@ -128,7 +128,7 @@ module Spree
128
128
  # @param [Spree::LineItem] line_item The line item which could not be saved
129
129
  # @return [void]
130
130
  def handle_error(line_item)
131
- order.errors[:base] << line_item.errors.full_messages
131
+ order.errors.add(:base, line_item.errors.full_messages)
132
132
  end
133
133
 
134
134
  # Save the order totals after merge
@@ -168,9 +168,16 @@ module Spree
168
168
 
169
169
  def validate_source
170
170
  if source && !source.valid?
171
- source.errors.each do |field, error|
172
- field_name = I18n.t("activerecord.attributes.#{source.class.to_s.underscore}.#{field}")
173
- errors.add(I18n.t(source.class.to_s.demodulize.underscore, scope: 'spree'), "#{field_name} #{error}")
171
+ if Gem::Requirement.new(">= 6.1").satisfied_by?(Rails.gem_version)
172
+ source.errors.each do |error|
173
+ field_name = I18n.t("activerecord.attributes.#{source.class.to_s.underscore}.#{error.attribute}")
174
+ errors.add(I18n.t(source.class.to_s.demodulize.underscore, scope: 'spree'), "#{field_name} #{error.message}")
175
+ end
176
+ else
177
+ source.errors.each do |field, error|
178
+ field_name = I18n.t("activerecord.attributes.#{source.class.to_s.underscore}.#{field}")
179
+ errors.add(I18n.t(source.class.to_s.demodulize.underscore, scope: 'spree'), "#{field_name} #{error}")
180
+ end
174
181
  end
175
182
  end
176
183
  if errors.any?
@@ -26,16 +26,10 @@ module Spree
26
26
  # @param payment [Spree::Payment] - the payment that should be canceled
27
27
  #
28
28
  def cancel(payment)
29
- # For payment methods already implemeting `try_void`
30
- if try_void_available?(payment.payment_method)
31
- if response = payment.payment_method.try_void(payment)
32
- payment.handle_void_response(response)
33
- else
34
- payment.refunds.create!(amount: payment.credit_allowed, reason: refund_reason, perform_after_create: false).perform!
35
- end
29
+ if response = payment.payment_method.try_void(payment)
30
+ payment.handle_void_response(response)
36
31
  else
37
- # For payment methods not yet implemeting `try_void`
38
- deprecated_behavior(payment)
32
+ payment.refunds.create!(amount: payment.credit_allowed, reason: refund_reason, perform_after_create: false).perform!
39
33
  end
40
34
  end
41
35
 
@@ -44,19 +38,6 @@ module Spree
44
38
  def refund_reason
45
39
  Spree::RefundReason.where(name: reason).first_or_create
46
40
  end
47
-
48
- def try_void_available?(payment_method)
49
- payment_method.respond_to?(:try_void) &&
50
- payment_method.method(:try_void).owner != Spree::PaymentMethod
51
- end
52
-
53
- def deprecated_behavior(payment)
54
- Spree::Deprecation.warn "#{payment.payment_method.class.name}#cancel is deprecated and will be removed. " \
55
- 'Please implement a `try_void` method instead that returns a response object if void succeeds ' \
56
- 'or `false|nil` if not. Solidus will refund the payment then.'
57
- response = payment.payment_method.cancel(payment.response_code)
58
- payment.handle_void_response(response)
59
- end
60
41
  end
61
42
  end
62
43
  end
@@ -23,9 +23,9 @@ module Spree
23
23
  end
24
24
 
25
25
  # @param payment [Spree::Payment] the payment we want to know if can be voided
26
- # @return [Boolean] true when the payment is not failed or voided
26
+ # @return [Boolean] true when the payment is not failed, voided or invalid
27
27
  def can_void?(payment)
28
- !payment.failed? && !payment.void?
28
+ payment.can_void?
29
29
  end
30
30
 
31
31
  # Indicates whether its possible to credit the payment. Note that most
@@ -366,8 +366,14 @@ module Spree
366
366
  # If the master is invalid, the Product object will be assigned its errors
367
367
  def validate_master
368
368
  unless master.valid?
369
- master.errors.each do |att, error|
370
- errors.add(att, error)
369
+ if Gem::Requirement.new(">= 6.1").satisfied_by?(Rails.gem_version)
370
+ master.errors.each do |error|
371
+ errors.add(error.attribute, error.message)
372
+ end
373
+ else
374
+ master.errors.each do |att, error|
375
+ errors.add(att, error)
376
+ end
371
377
  end
372
378
  end
373
379
  end
@@ -70,7 +70,6 @@ module Spree
70
70
  add_search_scope :in_taxon do |taxon|
71
71
  includes(:classifications)
72
72
  .where('spree_products_taxons.taxon_id' => taxon.self_and_descendants.pluck(:id))
73
- .select(Spree::Classification.arel_table[:position])
74
73
  .order(Spree::Classification.arel_table[:position].asc)
75
74
  end
76
75
 
@@ -119,7 +119,7 @@ module Spree
119
119
 
120
120
  def at_least_one_shipping_category
121
121
  if shipping_categories.empty?
122
- errors[:base] << "You need to select at least one shipping category"
122
+ errors.add(:base, "You need to select at least one shipping category")
123
123
  end
124
124
  end
125
125
  end
@@ -11,10 +11,10 @@ module Spree
11
11
  display_name = variant.name.to_s
12
12
  display_name += %{ (#{variant.options_text})} unless variant.options_text.blank?
13
13
 
14
- line_item.errors[:quantity] << I18n.t(
14
+ line_item.errors.add(:quantity, I18n.t(
15
15
  'spree.selected_quantity_not_available',
16
16
  item: display_name.inspect
17
- )
17
+ ))
18
18
  false
19
19
  end
20
20
  end
@@ -5,10 +5,10 @@ module Spree
5
5
  class InventoryValidator < ActiveModel::Validator
6
6
  def validate(line_item)
7
7
  if line_item.inventory_units.count != line_item.quantity
8
- line_item.errors[:inventory] << I18n.t(
8
+ line_item.errors.add(:inventory, I18n.t(
9
9
  'spree.inventory_not_available',
10
10
  item: line_item.variant.name
11
- )
11
+ ))
12
12
  end
13
13
  end
14
14
  end
@@ -9,11 +9,10 @@ module Spree::Taxon::ActiveStorageAttachment
9
9
  styles: { mini: '32x32>', normal: '128x128>' },
10
10
  default_style: :mini
11
11
  validate :icon_is_an_image
12
-
13
-
14
12
  end
15
13
 
16
14
  def attachment_partial_name
15
+ Spree::Deprecation.warn("calling #attachment_partial_name on Spree::Taxon is deprecated without replacement.")
17
16
  'paperclip'
18
17
  end
19
18
  end
@@ -20,6 +20,7 @@ module Spree::Taxon::PaperclipAttachment
20
20
  end
21
21
 
22
22
  def attachment_partial_name
23
+ Spree::Deprecation.warn("calling #attachment_partial_name on Spree::Taxon is deprecated without replacement.")
23
24
  'paperclip'
24
25
  end
25
26
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AddApplyToAllToVariantPropertyRule < ActiveRecord::Migration[5.1]
4
- def change
4
+ def up
5
5
  add_column :spree_variant_property_rules, :apply_to_all, :boolean, default: false, null: false
6
6
  change_column :spree_variant_property_rules, :apply_to_all, :boolean, default: true
7
7
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddNameToSpreeAddresses < ActiveRecord::Migration[5.2]
4
+ def up
5
+ add_column :spree_addresses, :name, :string
6
+ add_index :spree_addresses, :name
7
+ end
8
+
9
+ def down
10
+ remove_index :spree_addresses, :name
11
+ remove_column :spree_addresses, :name
12
+ end
13
+ end
@@ -20,11 +20,14 @@ Dummy::Application.configure do
20
20
  # Raise exceptions instead of rendering exception templates
21
21
  config.action_dispatch.show_exceptions = false
22
22
 
23
+ # Disable request forgery protection in test environment
24
+ config.action_controller.allow_forgery_protection = false
25
+
23
26
  # Tell Action Mailer not to deliver emails to the real world.
24
27
  # The :test delivery method accumulates sent emails in the
25
28
  # ActionMailer::Base.deliveries array.
26
29
  config.action_mailer.delivery_method = :test
27
- ActionMailer::Base.default from: "spree@example.com"
30
+ ActionMailer::Base.default from: "solidus@example.com"
28
31
 
29
32
  # Raise on deprecation warnings
30
33
  if ENV['SOLIDUS_RAISE_DEPRECATIONS'].present?
@@ -190,7 +190,7 @@ module Spree
190
190
 
191
191
  # @!attribute [rw] mails_from
192
192
  # @return [String] Email address used as +From:+ field in transactional emails.
193
- preference :mails_from, :string, default: 'spree@example.com'
193
+ preference :mails_from, :string, default: 'solidus@example.com'
194
194
 
195
195
  # @!attribute [rw] max_level_in_taxons_menu
196
196
  # @return [Integer] maximum nesting level in taxons menu (default: +1+)
data/lib/spree/core.rb CHANGED
@@ -90,11 +90,8 @@ require 'spree/core/state_machines'
90
90
  require 'spree/core/stock_configuration'
91
91
  require 'spree/core/validators/email'
92
92
  require 'spree/permission_sets'
93
+ require 'spree/user_class_handle'
93
94
 
94
95
  require 'spree/preferences/store'
95
96
  require 'spree/preferences/static_model_preferences'
96
97
  require 'spree/preferences/scoped_store'
97
-
98
- if Rails.gem_version >= Gem::Version.new('6.1.0.alpha')
99
- require 'spree/awesome_nested_set_override'
100
- end
@@ -86,19 +86,18 @@ module Spree
86
86
  Spree::Config.use_legacy_address_state_validator set to true has been
87
87
  deprecated and will be removed in Solidus 3.0. The Spree::Address state
88
88
  validation has been extracted into a configurable external class.
89
- Switch Spree::Config.use_legacy_address_state_validator to true to start
89
+ Switch Spree::Config.use_legacy_address_state_validator to false to start
90
90
  using the external validation class.
91
91
  DEPRECATION
92
92
  end
93
- end
94
93
 
95
- # Load in mailer previews for apps to use in development.
96
- # We need to make sure we call `Preview.all` before requiring our
97
- # previews, otherwise any previews the app attempts to add need to be
98
- # manually required.
99
- if Rails.env.development?
100
- initializer "spree.mailer_previews" do
94
+ # Load in mailer previews for apps to use in development.
95
+ # We need to make sure we call `Preview.all` before requiring our
96
+ # previews, otherwise any previews the app attempts to add need to be
97
+ # manually required.
98
+ if Rails.env.development? || Rails.env.test?
101
99
  ActionMailer::Preview.all
100
+
102
101
  Dir[root.join("lib/spree/mailer_previews/**/*_preview.rb")].each do |file|
103
102
  require_dependency file
104
103
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "2.11.2"
4
+ VERSION = "2.11.7"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION