spree_core 5.1.0.beta → 5.1.0.beta3
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.
- checksums.yaml +4 -4
- data/app/finders/spree/countries/find.rb +0 -8
- data/app/helpers/spree/base_helper.rb +4 -16
- data/app/helpers/spree/mail_helper.rb +6 -3
- data/app/helpers/spree/products_helper.rb +1 -4
- data/app/models/concerns/spree/product_scopes.rb +6 -1
- data/app/models/spree/address.rb +1 -1
- data/app/models/spree/order.rb +4 -0
- data/app/models/spree/product.rb +5 -2
- data/app/models/spree/product_property.rb +0 -13
- data/app/models/spree/stock_location.rb +5 -1
- data/app/models/spree/store.rb +3 -0
- data/config/locales/en.yml +2 -0
- data/db/migrate/20250527134027_add_company_to_spree_stock_locations.rb +5 -0
- data/lib/generators/spree/dummy/dummy_generator.rb +1 -1
- data/lib/generators/spree/dummy/templates/app/assets/config/manifest.js +0 -0
- data/lib/generators/spree/dummy/templates/rails/application.rb +1 -2
- data/lib/spree/core/configuration.rb +1 -1
- data/lib/spree/core/controller_helpers/common.rb +0 -71
- data/lib/spree/core/engine.rb +1 -1
- data/lib/spree/core/preferences/preferable.rb +10 -0
- data/lib/spree/core/preferences/preferable_class_methods.rb +52 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/permitted_attributes.rb +14 -5
- data/lib/spree/testing_support/controller_requests.rb +0 -92
- data/lib/spree/testing_support/factories/page_block_factory.rb +1 -0
- data/lib/spree/testing_support/factories/page_section_factory.rb +2 -0
- data/lib/spree/testing_support/factories/post_factory.rb +1 -1
- metadata +8 -8
- data/app/validators/db_maximum_length_validator.rb +0 -16
- data/lib/generators/spree/dummy/templates/rails/script/rails +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dbf1c3a02958e3dcb370c47d5cd4e9c209924301fcf451e91cdce682e60ea74
|
4
|
+
data.tar.gz: 83d62b4be4aeeb60fda78de84dfe73bd5ebf9603b32b5b938274be67a54c25a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdfef29cde021604e1309c49fd2218ced2bbf37c66b4642a88979955e57d6744a1f6630b1e8937aa4633d626f8c509bf8a7c3fc1c5bf76f0c5ba3f8472bd7fe1
|
7
|
+
data.tar.gz: a2d843bd61853ce37850019f7d378a83cd7fe88b523f1be07354271350498e851625caa9a49f969cbf338a00c12bb289d55a449f8a212d1a8290bab75d720971
|
@@ -7,14 +7,6 @@ module Spree
|
|
7
7
|
@shippable = String(params[:filter][:shippable]) unless params[:filter].nil?
|
8
8
|
end
|
9
9
|
|
10
|
-
def call
|
11
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
12
|
-
Spree::Countries::Find.new.call is deprecated and will be removed in Spree 5.0.
|
13
|
-
Please use Spree::Countries::Find.new.execute instead
|
14
|
-
DEPRECATION
|
15
|
-
execute
|
16
|
-
end
|
17
|
-
|
18
10
|
def execute
|
19
11
|
countries = by_shippability(scope)
|
20
12
|
|
@@ -136,10 +136,7 @@ module Spree
|
|
136
136
|
def pretty_time(time)
|
137
137
|
return '' if time.blank?
|
138
138
|
|
139
|
-
Spree::Deprecation.warn(
|
140
|
-
`BaseHelper#pretty_time` is deprecated and will be removed in Spree 6.0.
|
141
|
-
Please add `local_time` gem to your Gemfile and use `local_time(time)` instead
|
142
|
-
DEPRECATION
|
139
|
+
Spree::Deprecation.warn('BaseHelper#pretty_time is deprecated and will be removed in Spree 6.0. Please add `local_time` gem to your Gemfile and use `local_time(time)` instead')
|
143
140
|
|
144
141
|
[I18n.l(time.to_date, format: :long), time.strftime('%l:%M %p %Z')].join(' ')
|
145
142
|
end
|
@@ -147,10 +144,7 @@ module Spree
|
|
147
144
|
def pretty_date(date)
|
148
145
|
return '' if date.blank?
|
149
146
|
|
150
|
-
Spree::Deprecation.warn(
|
151
|
-
`BaseHelper#pretty_date` is deprecated and will be removed in Spree 6.0.
|
152
|
-
Please add `local_time` gem to your Gemfile and use `local_date(date)` instead
|
153
|
-
DEPRECATION
|
147
|
+
Spree::Deprecation.warn('BaseHelper#pretty_date is deprecated and will be removed in Spree 6.0. Please add `local_time` gem to your Gemfile and use `local_date(date)` instead')
|
154
148
|
|
155
149
|
[I18n.l(date.to_date, format: :long)].join(' ')
|
156
150
|
end
|
@@ -219,19 +213,13 @@ module Spree
|
|
219
213
|
# we should always try to render image of the default variant
|
220
214
|
# same as it's done on PDP
|
221
215
|
def default_image_for_product(product)
|
222
|
-
Spree::Deprecation.warn(
|
223
|
-
`BaseHelper#default_image_for_product` is deprecated and will be removed in Spree 6.0.
|
224
|
-
Please use `product.default_image` instead
|
225
|
-
DEPRECATION
|
216
|
+
Spree::Deprecation.warn('BaseHelper#default_image_for_product is deprecated and will be removed in Spree 6.0. Please use product.default_image instead')
|
226
217
|
|
227
218
|
product.default_image
|
228
219
|
end
|
229
220
|
|
230
221
|
def default_image_for_product_or_variant(product_or_variant)
|
231
|
-
Spree::Deprecation.warn(
|
232
|
-
`BaseHelper#default_image_for_product_or_variant` is deprecated and will be removed in Spree 6.0.
|
233
|
-
Please use `product_or_variant.default_image` instead
|
234
|
-
DEPRECATION
|
222
|
+
Spree::Deprecation.warn('BaseHelper#default_image_for_product_or_variant is deprecated and will be removed in Spree 6.0. Please use product_or_variant.default_image instead')
|
235
223
|
|
236
224
|
product_or_variant.default_image
|
237
225
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module Spree
|
2
2
|
module MailHelper
|
3
|
-
include BaseHelper
|
3
|
+
include Spree::BaseHelper
|
4
|
+
include Spree::ImagesHelper
|
4
5
|
|
5
6
|
def variant_image_url(variant)
|
6
|
-
image =
|
7
|
-
image ?
|
7
|
+
image = variant.default_image
|
8
|
+
image.present? && image.attached? ? spree_image_url(image, width: 100, height: 100) : image_url('noimage/small.png')
|
8
9
|
end
|
9
10
|
|
10
11
|
def name_for(order)
|
@@ -16,6 +17,8 @@ module Spree
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def logo_path
|
20
|
+
Spree::Deprecation.warn('logo_path is deprecated and will be removed in Spree 6.0. Please use Active Storage URL helpers instead.')
|
21
|
+
|
19
22
|
return main_app.cdn_image_url(store_logo.variant(resize_to_limit: [244, 104])) if store_logo&.variable?
|
20
23
|
|
21
24
|
return main_app.cdn_image_url(store_logo) if store_logo&.image?
|
@@ -121,10 +121,7 @@ module Spree
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def related_products
|
124
|
-
Spree::Deprecation.warn(
|
125
|
-
ProductsHelper#related_products is deprecated and will be removed in Spree 5.0.
|
126
|
-
Please use ProductsHelper#relations from now on.
|
127
|
-
DEPRECATION
|
124
|
+
Spree::Deprecation.warn('ProductsHelper#related_products is deprecated and will be removed in Spree 6.0. Please use ProductsHelper#relations from now on.')
|
128
125
|
|
129
126
|
return [] unless @product.respond_to?(:has_related_products?)
|
130
127
|
|
@@ -305,7 +305,12 @@ module Spree
|
|
305
305
|
# .search_by_name
|
306
306
|
if defined?(PgSearch)
|
307
307
|
include PgSearch::Model
|
308
|
-
|
308
|
+
|
309
|
+
if connected? && connection.extension_enabled?('pg_trgm')
|
310
|
+
pg_search_scope :search_by_name, against: { name: 'A', meta_title: 'B' }, using: { trigram: { threshold: 0.3, word_similarity: true } }
|
311
|
+
else
|
312
|
+
pg_search_scope :search_by_name, against: { name: 'A', meta_title: 'B' }, using: { tsearch: { any_word: true, prefix: true } }
|
313
|
+
end
|
309
314
|
else
|
310
315
|
def self.search_by_name(query)
|
311
316
|
i18n { name.lower.matches("%#{query.downcase}%") }
|
data/app/models/spree/address.rb
CHANGED
data/app/models/spree/order.rb
CHANGED
data/app/models/spree/product.rb
CHANGED
@@ -50,8 +50,11 @@ module Spree
|
|
50
50
|
if defined?(PgSearch)
|
51
51
|
include PgSearch::Model
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
if connected? && connection.extension_enabled?('pg_trgm')
|
54
|
+
pg_search_scope :search_by_name, against: { name: 'A', meta_title: 'B' }, using: { trigram: { threshold: 0.3, word_similarity: true } }
|
55
|
+
else
|
56
|
+
pg_search_scope :search_by_name, against: { name: 'A', meta_title: 'B' }, using: { tsearch: { any_word: true, prefix: true } }
|
57
|
+
end
|
55
58
|
end
|
56
59
|
|
57
60
|
before_save :set_slug
|
@@ -42,19 +42,6 @@ module Spree
|
|
42
42
|
# virtual attributes for use with AJAX completion stuff
|
43
43
|
delegate :name, :presentation, to: :property, prefix: true, allow_nil: true
|
44
44
|
|
45
|
-
def property_name=(name)
|
46
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
47
|
-
`ProductProperty#property_name=` is deprecated and will be removed in Spree 5.0.
|
48
|
-
DEPRECATION
|
49
|
-
if name.present?
|
50
|
-
self.property = if Property.where(name: name).exists?
|
51
|
-
Property.where(name: name).first
|
52
|
-
else
|
53
|
-
Property.create(name: name, presentation: name)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
45
|
protected
|
59
46
|
|
60
47
|
def param_candidate
|
@@ -29,7 +29,6 @@ module Spree
|
|
29
29
|
after_update :conditional_touch_records
|
30
30
|
|
31
31
|
delegate :name, :iso3, :iso, :iso_name, to: :country, prefix: true
|
32
|
-
delegate :show_company_address_field?, to: :address
|
33
32
|
|
34
33
|
def state_text
|
35
34
|
state.try(:abbr) || state.try(:name) || state_name
|
@@ -136,6 +135,7 @@ module Spree
|
|
136
135
|
Spree::Address.new(
|
137
136
|
address1: address1,
|
138
137
|
address2: address2,
|
138
|
+
company: company,
|
139
139
|
city: city,
|
140
140
|
state: state,
|
141
141
|
state_name: state_name,
|
@@ -159,6 +159,10 @@ module Spree
|
|
159
159
|
false
|
160
160
|
end
|
161
161
|
|
162
|
+
def show_company_address_field?
|
163
|
+
true
|
164
|
+
end
|
165
|
+
|
162
166
|
def display_name
|
163
167
|
@display_name ||= [admin_name, name].delete_if(&:blank?).join(' / ')
|
164
168
|
end
|
data/app/models/spree/store.rb
CHANGED
@@ -48,6 +48,9 @@ module Spree
|
|
48
48
|
preference :password_protected, :boolean, default: false
|
49
49
|
# Checkout preferences
|
50
50
|
preference :guest_checkout, :boolean, default: true
|
51
|
+
preference :special_instructions_enabled, :boolean, default: false
|
52
|
+
# Address preferences
|
53
|
+
preference :company_field_enabled, :boolean, default: false
|
51
54
|
# digital assets preferences
|
52
55
|
preference :limit_digital_download_count, :boolean, default: true
|
53
56
|
preference :limit_digital_download_days, :boolean, default: true
|
data/config/locales/en.yml
CHANGED
@@ -567,6 +567,7 @@ en:
|
|
567
567
|
receive: Mark as received
|
568
568
|
refund: Refund
|
569
569
|
reject: Reject
|
570
|
+
remove: Remove
|
570
571
|
resend: Resend
|
571
572
|
resolve: Mark as resolved
|
572
573
|
save: Save
|
@@ -630,6 +631,7 @@ en:
|
|
630
631
|
successfully_updated: Updated successfully
|
631
632
|
unsuccessfully_saved: There was an error while trying to save your address.
|
632
633
|
unsuccessfully_updated: There was an update while trying to update your address.
|
634
|
+
address_settings: Address settings
|
633
635
|
addresses: Addresses
|
634
636
|
adjustable: Adjustable
|
635
637
|
adjustment: Adjustment
|
@@ -54,8 +54,8 @@ module Spree
|
|
54
54
|
template 'rails/application.rb', "#{dummy_path}/config/application.rb", force: true
|
55
55
|
template 'rails/routes.rb', "#{dummy_path}/config/routes.rb", force: true
|
56
56
|
template 'rails/test.rb', "#{dummy_path}/config/environments/test.rb", force: true
|
57
|
-
template 'rails/script/rails', "#{dummy_path}/spec/dummy/script/rails", force: true
|
58
57
|
template 'initializers/devise.rb', "#{dummy_path}/config/initializers/devise.rb", force: true
|
58
|
+
template "app/assets/config/manifest.js", "#{dummy_path}/app/assets/config/manifest.js", force: true
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_dummy_inject_extension_requirements
|
File without changes
|
@@ -37,7 +37,7 @@ module Spree
|
|
37
37
|
preference :auto_capture_on_dispatch, :boolean, default: false # Captures payment for each shipment in Shipment#after_ship callback, and makes Shipment.ready when payment authorized.
|
38
38
|
preference :binary_inventory_cache, :boolean, default: false, deprecated: true # only invalidate product cache when a stock item changes whether it is in_stock
|
39
39
|
preference :checkout_zone, :string, default: nil, deprecated: true # replace with the name of a zone if you would like to limit the countries
|
40
|
-
preference :company, :boolean, default: false # Request company field for billing and shipping addr
|
40
|
+
preference :company, :boolean, default: false, deprecated: 'Use the company_field_enabled preference in the Spree::Store model' # Request company field for billing and shipping addr
|
41
41
|
preference :currency, :string, default: 'USD', deprecated: true
|
42
42
|
preference :credit_to_new_allocation, :boolean, default: false
|
43
43
|
preference :disable_sku_validation, :boolean, default: false # when turned off disables the built-in SKU uniqueness validation
|
@@ -2,77 +2,6 @@ module Spree
|
|
2
2
|
module Core
|
3
3
|
module ControllerHelpers
|
4
4
|
module Common
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
included do
|
7
|
-
helper_method :title
|
8
|
-
helper_method :title=
|
9
|
-
helper_method :accurate_title
|
10
|
-
|
11
|
-
layout :get_layout
|
12
|
-
|
13
|
-
protected
|
14
|
-
|
15
|
-
# can be used in views as well as controllers.
|
16
|
-
# e.g. <% self.title = 'This is a custom title for this view' %>
|
17
|
-
attr_writer :title
|
18
|
-
|
19
|
-
def title
|
20
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
21
|
-
ControllerHelpers::Common is deprecated and will be removed in Spree 5.0.
|
22
|
-
DEPRECATION
|
23
|
-
title_string = @title.present? ? @title : accurate_title
|
24
|
-
if title_string.present?
|
25
|
-
if Spree::Config[:always_put_site_name_in_title] && !title_string.include?(default_title)
|
26
|
-
[title_string, default_title].join(" #{Spree::Config[:title_site_name_separator]} ")
|
27
|
-
else
|
28
|
-
title_string
|
29
|
-
end
|
30
|
-
else
|
31
|
-
default_title
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def default_title
|
36
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
37
|
-
ControllerHelpers::Common is deprecated and will be removed in Spree 5.0.
|
38
|
-
DEPRECATION
|
39
|
-
current_store.name
|
40
|
-
end
|
41
|
-
|
42
|
-
# this is a hook for subclasses to provide title
|
43
|
-
def accurate_title
|
44
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
45
|
-
ControllerHelpers::Common is deprecated and will be removed in Spree 5.0.
|
46
|
-
DEPRECATION
|
47
|
-
current_store.seo_title
|
48
|
-
end
|
49
|
-
|
50
|
-
private
|
51
|
-
|
52
|
-
def set_user_language
|
53
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
54
|
-
ControllerHelpers::Common#set_user_language is deprecated and will be removed in Spree 5.0.
|
55
|
-
Please use `before_action :set_locale` instead
|
56
|
-
DEPRECATION
|
57
|
-
|
58
|
-
set_locale
|
59
|
-
end
|
60
|
-
|
61
|
-
# Returns which layout to render.
|
62
|
-
#
|
63
|
-
# You can set the layout you want to render inside your Spree configuration with the +:layout+ option.
|
64
|
-
#
|
65
|
-
# Default layout is: +app/views/spree/layouts/spree_application+
|
66
|
-
#
|
67
|
-
def get_layout
|
68
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
69
|
-
ControllerHelpers::Common is deprecated and will be removed in Spree 5.0.
|
70
|
-
DEPRECATION
|
71
|
-
return unless defined?(Spree::Frontend)
|
72
|
-
|
73
|
-
layout ||= Spree::Frontend::Config[:layout]
|
74
|
-
end
|
75
|
-
end
|
76
5
|
end
|
77
6
|
end
|
78
7
|
end
|
data/lib/spree/core/engine.rb
CHANGED
@@ -42,7 +42,7 @@ module Spree
|
|
42
42
|
Spree::Config = app.config.spree.preferences
|
43
43
|
Spree::RuntimeConfig = app.config.spree.preferences # for compatibility
|
44
44
|
Spree::Dependencies = app.config.spree.dependencies
|
45
|
-
Spree::Deprecation = ActiveSupport::Deprecation.new
|
45
|
+
Spree::Deprecation = ActiveSupport::Deprecation.new('6.0', 'Spree')
|
46
46
|
end
|
47
47
|
|
48
48
|
initializer 'spree.register.calculators', before: :after_initialize do |app|
|
@@ -108,6 +108,16 @@ module Spree::Preferences::Preferable
|
|
108
108
|
preference_keys.each { |pref| preferences[pref] = preference_default(pref) }
|
109
109
|
end
|
110
110
|
|
111
|
+
def preference_change(name, changes_or_previous_changes)
|
112
|
+
preference_changes = changes_or_previous_changes.with_indifferent_access.fetch('preferences', [{}, {}])
|
113
|
+
before_preferences = preference_changes[0] || {}
|
114
|
+
after_preferences = preference_changes[1] || {}
|
115
|
+
|
116
|
+
return if before_preferences[name] == after_preferences[name]
|
117
|
+
|
118
|
+
[before_preferences[name], after_preferences[name]]
|
119
|
+
end
|
120
|
+
|
111
121
|
private
|
112
122
|
|
113
123
|
def convert_preference_value(value, type, nullable: false)
|
@@ -43,6 +43,34 @@ module Spree::Preferences
|
|
43
43
|
define_method prefers_query_method(name) do
|
44
44
|
preferences.fetch(name).to_b
|
45
45
|
end
|
46
|
+
|
47
|
+
define_method preference_change_method(name) do
|
48
|
+
preference_change(name, changes) if respond_to?(:changes)
|
49
|
+
end
|
50
|
+
|
51
|
+
define_method preference_was_method(name) do
|
52
|
+
return unless respond_to?(:changes)
|
53
|
+
|
54
|
+
preference_change(name, changes)&.first || get_preference(name)
|
55
|
+
end
|
56
|
+
|
57
|
+
define_method preference_changed_method(name) do
|
58
|
+
respond_to?(:changes) && preference_change(name, changes).present?
|
59
|
+
end
|
60
|
+
|
61
|
+
define_method preference_previous_change_method(name) do
|
62
|
+
preference_change(name, previous_changes) if respond_to?(:previous_changes)
|
63
|
+
end
|
64
|
+
|
65
|
+
define_method preference_previous_was_method(name) do
|
66
|
+
return unless respond_to?(:previous_changes)
|
67
|
+
|
68
|
+
preference_change(name, previous_changes)&.first
|
69
|
+
end
|
70
|
+
|
71
|
+
define_method preference_previous_changed_method(name) do
|
72
|
+
respond_to?(:previous_changes) && preference_change(name, previous_changes).present?
|
73
|
+
end
|
46
74
|
end
|
47
75
|
|
48
76
|
def preference_getter_method(name)
|
@@ -68,5 +96,29 @@ module Spree::Preferences
|
|
68
96
|
def prefers_query_method(name)
|
69
97
|
"prefers_#{name}?".to_sym
|
70
98
|
end
|
99
|
+
|
100
|
+
def preference_change_method(name)
|
101
|
+
"preferred_#{name}_change".to_sym
|
102
|
+
end
|
103
|
+
|
104
|
+
def preference_was_method(name)
|
105
|
+
"preferred_#{name}_was".to_sym
|
106
|
+
end
|
107
|
+
|
108
|
+
def preference_changed_method(name)
|
109
|
+
"preferred_#{name}_changed?".to_sym
|
110
|
+
end
|
111
|
+
|
112
|
+
def preference_previous_change_method(name)
|
113
|
+
"preferred_#{name}_previous_change".to_sym
|
114
|
+
end
|
115
|
+
|
116
|
+
def preference_previous_was_method(name)
|
117
|
+
"preferred_#{name}_previously_was".to_sym
|
118
|
+
end
|
119
|
+
|
120
|
+
def preference_previous_changed_method(name)
|
121
|
+
"preferred_#{name}_previously_changed?".to_sym
|
122
|
+
end
|
71
123
|
end
|
72
124
|
end
|
data/lib/spree/core/version.rb
CHANGED
@@ -22,10 +22,13 @@ module Spree
|
|
22
22
|
:option_type_attributes,
|
23
23
|
:option_value_attributes,
|
24
24
|
:page_attributes,
|
25
|
+
:page_block_attributes,
|
25
26
|
:page_link_attributes,
|
26
27
|
:page_section_attributes,
|
27
28
|
:payment_attributes,
|
28
29
|
:payment_method_attributes,
|
30
|
+
:post_attributes,
|
31
|
+
:post_category_attributes,
|
29
32
|
:product_attributes,
|
30
33
|
:promotion_attributes,
|
31
34
|
:promotion_rule_attributes,
|
@@ -100,7 +103,7 @@ module Spree
|
|
100
103
|
|
101
104
|
@@digital_link_attributes = [:access_counter]
|
102
105
|
|
103
|
-
@@export_attributes = [:type, :format, :record_selection, search_params
|
106
|
+
@@export_attributes = [:type, :format, :record_selection, :search_params]
|
104
107
|
|
105
108
|
@@image_attributes = [:alt, :attachment, :position, :viewable_type, :viewable_id]
|
106
109
|
|
@@ -124,14 +127,20 @@ module Spree
|
|
124
127
|
|
125
128
|
@@page_attributes = [:name, :slug, :meta_title, :meta_description, :meta_keywords]
|
126
129
|
|
127
|
-
@@
|
130
|
+
@@page_block_attributes = [:type, :name, :text, :position]
|
128
131
|
|
129
|
-
@@
|
132
|
+
@@page_link_attributes = [:linkable_id, :linkable_type, :position, :label, :url, :open_in_new_tab]
|
133
|
+
|
134
|
+
@@page_section_attributes = [:type, :name, :position, :asset, :text, :description]
|
130
135
|
|
131
136
|
@@payment_attributes = [:amount, :payment_method_id, :payment_method]
|
132
137
|
|
133
138
|
@@payment_method_attributes = [:name, :type, :description, :active, :display_on, :auto_capture, :position]
|
134
139
|
|
140
|
+
@@post_attributes = [:title, :meta_title, :meta_description, :slug, :author_id, :post_category_id, :published_at, :content, :excerpt, :image, tag_list: []]
|
141
|
+
|
142
|
+
@@post_category_attributes = [:title, :slug, :description]
|
143
|
+
|
135
144
|
@@product_properties_attributes = [:property_name, :property_id, :value, :position, :_destroy]
|
136
145
|
|
137
146
|
@@product_attributes = [
|
@@ -167,7 +176,7 @@ module Spree
|
|
167
176
|
|
168
177
|
@@reimbursement_attributes = [return_items_attributes: [:id, :override_reimbursement_type_id, :pre_tax_amount, :exchange_variant_id]]
|
169
178
|
|
170
|
-
@@reimbursement_type_attributes = [:name, :active]
|
179
|
+
@@reimbursement_type_attributes = [:name, :type, :active, :mutable]
|
171
180
|
|
172
181
|
@@report_attributes = [:type, :date_from, :date_to, :currency]
|
173
182
|
|
@@ -204,7 +213,7 @@ module Spree
|
|
204
213
|
@@stock_item_attributes = [:variant_id, :stock_location_id, :backorderable, :count_on_hand]
|
205
214
|
|
206
215
|
@@stock_location_attributes = [
|
207
|
-
:name, :active, :address1, :address2, :city, :zipcode,
|
216
|
+
:name, :active, :address1, :address2, :city, :zipcode, :company,
|
208
217
|
:backorderable_default, :state_name, :state_id, :country_id, :phone,
|
209
218
|
:propagate_all_variants
|
210
219
|
]
|
@@ -6,98 +6,6 @@ module Spree
|
|
6
6
|
included do
|
7
7
|
routes { Spree::Core::Engine.routes }
|
8
8
|
end
|
9
|
-
|
10
|
-
def spree_get(action, parameters = nil, session = nil, flash = nil)
|
11
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
12
|
-
ControllerRequests#spree_get is deprecated and will be removed in Spree 5.0.
|
13
|
-
Please use get, params: {}
|
14
|
-
DEPRECATION
|
15
|
-
process_spree_action(action, parameters, session, flash, 'GET')
|
16
|
-
end
|
17
|
-
|
18
|
-
# Executes a request simulating POST HTTP method and set/volley the response
|
19
|
-
def spree_post(action, parameters = nil, session = nil, flash = nil)
|
20
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
21
|
-
ControllerRequests#spree_post is deprecated and will be removed in Spree 5.0.
|
22
|
-
Please use post, params: {}
|
23
|
-
DEPRECATION
|
24
|
-
process_spree_action(action, parameters, session, flash, 'POST')
|
25
|
-
end
|
26
|
-
|
27
|
-
# Executes a request simulating PUT HTTP method and set/volley the response
|
28
|
-
def spree_put(action, parameters = nil, session = nil, flash = nil)
|
29
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
30
|
-
ControllerRequests#spree_put is deprecated and will be removed in Spree 5.0.
|
31
|
-
Please use put, params: {}
|
32
|
-
DEPRECATION
|
33
|
-
process_spree_action(action, parameters, session, flash, 'PUT')
|
34
|
-
end
|
35
|
-
|
36
|
-
# # Executes a request simulating PATCH HTTP method and set/volley the response
|
37
|
-
def spree_patch(action, parameters = nil, session = nil, flash = nil)
|
38
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
39
|
-
ControllerRequests#spree_patch is deprecated and will be removed in Spree 5.0.
|
40
|
-
Please use patch, params: {}
|
41
|
-
DEPRECATION
|
42
|
-
process_spree_action(action, parameters, session, flash, 'PATCH')
|
43
|
-
end
|
44
|
-
|
45
|
-
# Executes a request simulating DELETE HTTP method and set/volley the response
|
46
|
-
def spree_delete(action, parameters = nil, session = nil, flash = nil)
|
47
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
48
|
-
ControllerRequests#spree_delete is deprecated and will be removed in Spree 5.0.
|
49
|
-
Please use delete, params: {}
|
50
|
-
DEPRECATION
|
51
|
-
process_spree_action(action, parameters, session, flash, 'DELETE')
|
52
|
-
end
|
53
|
-
|
54
|
-
def spree_xhr_get(action, parameters = nil, session = nil, flash = nil)
|
55
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
56
|
-
ControllerRequests#spree_xhr_get is deprecated and will be removed in Spree 5.0.
|
57
|
-
DEPRECATION
|
58
|
-
process_spree_xhr_action(action, parameters, session, flash, :get)
|
59
|
-
end
|
60
|
-
|
61
|
-
def spree_xhr_post(action, parameters = nil, session = nil, flash = nil)
|
62
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
63
|
-
ControllerRequests#spree_xhr_post is deprecated and will be removed in Spree 5.0.
|
64
|
-
DEPRECATION
|
65
|
-
process_spree_xhr_action(action, parameters, session, flash, :post)
|
66
|
-
end
|
67
|
-
|
68
|
-
def spree_xhr_put(action, parameters = nil, session = nil, flash = nil)
|
69
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
70
|
-
ControllerRequests#spree_xhr_put is deprecated and will be removed in Spree 5.0.
|
71
|
-
DEPRECATION
|
72
|
-
process_spree_xhr_action(action, parameters, session, flash, :put)
|
73
|
-
end
|
74
|
-
|
75
|
-
def spree_xhr_patch(action, parameters = nil, session = nil, flash = nil)
|
76
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
77
|
-
ControllerRequests#spree_xhr_patch is deprecated and will be removed in Spree 5.0.
|
78
|
-
DEPRECATION
|
79
|
-
process_spree_xhr_action(action, parameters, session, flash, :patch)
|
80
|
-
end
|
81
|
-
|
82
|
-
def spree_xhr_delete(action, parameters = nil, session = nil, flash = nil)
|
83
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
84
|
-
ControllerRequests#spree_xhr_delete is deprecated and will be removed in Spree 5.0.
|
85
|
-
DEPRECATION
|
86
|
-
process_spree_xhr_action(action, parameters, session, flash, :delete)
|
87
|
-
end
|
88
|
-
|
89
|
-
private
|
90
|
-
|
91
|
-
def process_spree_action(action, parameters = nil, session = nil, flash = nil, method = 'GET')
|
92
|
-
parameters ||= {}
|
93
|
-
process(action, method: method, params: parameters, session: session, flash: flash)
|
94
|
-
end
|
95
|
-
|
96
|
-
def process_spree_xhr_action(action, parameters = nil, session = nil, flash = nil, method = :get)
|
97
|
-
parameters ||= {}
|
98
|
-
parameters.reverse_merge!(format: :json)
|
99
|
-
process(action, method: method, params: parameters, session: session, flash: flash, xhr: true)
|
100
|
-
end
|
101
9
|
end
|
102
10
|
end
|
103
11
|
end
|
@@ -20,5 +20,7 @@ FactoryBot.define do
|
|
20
20
|
factory :newsletter_page_section, class: Spree::PageSections::Newsletter
|
21
21
|
|
22
22
|
factory :video_page_section, class: Spree::PageSections::Video
|
23
|
+
|
24
|
+
factory :image_with_text_page_section, class: Spree::PageSections::ImageWithText
|
23
25
|
end
|
24
26
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :post, class: Spree::Post do
|
3
|
-
post_category { create(:post_category) }
|
3
|
+
post_category { create(:post_category, store: Spree::Store.default || create(:store)) }
|
4
4
|
title { FFaker::Lorem.sentence }
|
5
5
|
content { FFaker::Lorem.paragraph }
|
6
6
|
published_at { Time.current }
|
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: 5.1.0.
|
4
|
+
version: 5.1.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-05-
|
13
|
+
date: 2025-05-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n-tasks
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '7.2'
|
36
36
|
- - "<"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: '8.
|
38
|
+
version: '8.1'
|
39
39
|
type: :runtime
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
version: '7.2'
|
46
46
|
- - "<"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '8.
|
48
|
+
version: '8.1'
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: activemerchant
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1024,7 +1024,6 @@ files:
|
|
1024
1024
|
- app/sorters/spree/classifications/sort.rb
|
1025
1025
|
- app/sorters/spree/orders/sort.rb
|
1026
1026
|
- app/sorters/spree/products/sort.rb
|
1027
|
-
- app/validators/db_maximum_length_validator.rb
|
1028
1027
|
- app/validators/email_validator.rb
|
1029
1028
|
- app/validators/spree/url_validator.rb
|
1030
1029
|
- app/views/action_text/video_embeds/_thumbnail.html.erb
|
@@ -1159,6 +1158,7 @@ files:
|
|
1159
1158
|
- db/migrate/20250418174652_add_resource_to_spree_role_users.rb
|
1160
1159
|
- db/migrate/20250508060800_add_selected_locale_to_spree_admin_users.rb
|
1161
1160
|
- db/migrate/20250509143831_add_session_id_to_spree_assets.rb
|
1161
|
+
- db/migrate/20250527134027_add_company_to_spree_stock_locations.rb
|
1162
1162
|
- db/seeds.rb
|
1163
1163
|
- lib/friendly_id/paranoia.rb
|
1164
1164
|
- lib/generators/spree/authentication/custom/custom_generator.rb
|
@@ -1166,12 +1166,12 @@ files:
|
|
1166
1166
|
- lib/generators/spree/authentication/devise/devise_generator.rb
|
1167
1167
|
- lib/generators/spree/authentication/devise/templates/authentication_helpers.rb.tt
|
1168
1168
|
- lib/generators/spree/dummy/dummy_generator.rb
|
1169
|
+
- lib/generators/spree/dummy/templates/app/assets/config/manifest.js
|
1169
1170
|
- lib/generators/spree/dummy/templates/initializers/devise.rb
|
1170
1171
|
- lib/generators/spree/dummy/templates/rails/application.rb
|
1171
1172
|
- lib/generators/spree/dummy/templates/rails/boot.rb
|
1172
1173
|
- lib/generators/spree/dummy/templates/rails/database.yml
|
1173
1174
|
- lib/generators/spree/dummy/templates/rails/routes.rb
|
1174
|
-
- lib/generators/spree/dummy/templates/rails/script/rails
|
1175
1175
|
- lib/generators/spree/dummy/templates/rails/test.rb
|
1176
1176
|
- lib/generators/spree/dummy_model/dummy_model_generator.rb
|
1177
1177
|
- lib/generators/spree/dummy_model/templates/migration.rb.tt
|
@@ -1345,9 +1345,9 @@ licenses:
|
|
1345
1345
|
- BSD-3-Clause
|
1346
1346
|
metadata:
|
1347
1347
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1348
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.
|
1348
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta3
|
1349
1349
|
documentation_uri: https://docs.spreecommerce.org/
|
1350
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.1.0.
|
1350
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta3
|
1351
1351
|
post_install_message:
|
1352
1352
|
rdoc_options: []
|
1353
1353
|
require_paths:
|
@@ -1,16 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# Validates a field based on the maximum length of the underlying DB field, if there is one.
|
3
|
-
class DbMaximumLengthValidator < ActiveModel::EachValidator
|
4
|
-
def validate_each(record, attribute, value)
|
5
|
-
Spree::Deprecation.warn(<<-DEPRECATION, caller)
|
6
|
-
`DbMaximumLengthValidator` is deprecated and will be removed in Spree 5.0.
|
7
|
-
Please remove any `db_maximum_length: true` validations from your codebase
|
8
|
-
DEPRECATION
|
9
|
-
|
10
|
-
limit = record.class.columns_hash[attribute.to_s].limit
|
11
|
-
value = record[attribute.to_sym]
|
12
|
-
if value && limit && value.to_s.length > limit
|
13
|
-
record.errors.add(attribute.to_sym, :too_long, count: limit)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|