spree_core 5.1.0.beta2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8150046e1776256aacec11512b848d9cbd5074d17b7aacafd7b2736cfd934c3
4
- data.tar.gz: 8a04db5d73b2abf21a587ea66313d4fb7ff7120ed46ef9d22f38ddf1b3c5f295
3
+ metadata.gz: 7dbf1c3a02958e3dcb370c47d5cd4e9c209924301fcf451e91cdce682e60ea74
4
+ data.tar.gz: 83d62b4be4aeeb60fda78de84dfe73bd5ebf9603b32b5b938274be67a54c25a0
5
5
  SHA512:
6
- metadata.gz: 8024d8aa8b617d7be12713acf1787a7c4569dc708d74cbf34850ec6bc8fcea5630c15fdfe6efa4796c82825fc9724d637b219da887f888f909dd29d22582178f
7
- data.tar.gz: 60db3009f9a9a30bfca2b8c6895b7777a35eaac8819ca06a112e2315e234137ee87e5fea3796335e53e8a8e5c562f22183d7d8c6c3c3b1f8e9466d76ba3bbde5
6
+ metadata.gz: fdfef29cde021604e1309c49fd2218ced2bbf37c66b4642a88979955e57d6744a1f6630b1e8937aa4633d626f8c509bf8a7c3fc1c5bf76f0c5ba3f8472bd7fe1
7
+ data.tar.gz: a2d843bd61853ce37850019f7d378a83cd7fe88b523f1be07354271350498e851625caa9a49f969cbf338a00c12bb289d55a449f8a212d1a8290bab75d720971
@@ -17,6 +17,8 @@ module Spree
17
17
  end
18
18
 
19
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
+
20
22
  return main_app.cdn_image_url(store_logo.variant(resize_to_limit: [244, 104])) if store_logo&.variable?
21
23
 
22
24
  return main_app.cdn_image_url(store_logo) if store_logo&.image?
@@ -305,7 +305,12 @@ module Spree
305
305
  # .search_by_name
306
306
  if defined?(PgSearch)
307
307
  include PgSearch::Model
308
- pg_search_scope :search_by_name, against: { name: 'A', meta_title: 'B' }, using: { tsearch: { any_word: true, prefix: true } }
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}%") }
@@ -189,7 +189,7 @@ module Spree
189
189
  end
190
190
 
191
191
  def show_company_address_field?
192
- false
192
+ Spree::Store.current.prefers_company_field_enabled?
193
193
  end
194
194
 
195
195
  def editable?
@@ -50,8 +50,11 @@ module Spree
50
50
  if defined?(PgSearch)
51
51
  include PgSearch::Model
52
52
 
53
- pg_search_scope :search_by_name, against: { name: 'A', meta_title: 'B' },
54
- using: { tsearch: { prefix: true, any_word: true } }
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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,5 @@
1
+ class AddCompanyToSpreeStockLocations < ActiveRecord::Migration[7.2]
2
+ def change
3
+ add_column :spree_stock_locations, :company, :string, if_not_exists: true
4
+ end
5
+ end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '5.1.0.beta2'.freeze
2
+ VERSION = '5.1.0.beta3'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -27,6 +27,8 @@ module Spree
27
27
  :page_section_attributes,
28
28
  :payment_attributes,
29
29
  :payment_method_attributes,
30
+ :post_attributes,
31
+ :post_category_attributes,
30
32
  :product_attributes,
31
33
  :promotion_attributes,
32
34
  :promotion_rule_attributes,
@@ -101,7 +103,7 @@ module Spree
101
103
 
102
104
  @@digital_link_attributes = [:access_counter]
103
105
 
104
- @@export_attributes = [:type, :format, :record_selection, search_params: {}]
106
+ @@export_attributes = [:type, :format, :record_selection, :search_params]
105
107
 
106
108
  @@image_attributes = [:alt, :attachment, :position, :viewable_type, :viewable_id]
107
109
 
@@ -125,16 +127,20 @@ module Spree
125
127
 
126
128
  @@page_attributes = [:name, :slug, :meta_title, :meta_description, :meta_keywords]
127
129
 
128
- @@page_block_attributes = [:type, :name, :position]
130
+ @@page_block_attributes = [:type, :name, :text, :position]
129
131
 
130
- @@page_link_attributes = [:linkable_id, :linkable_type, :position, :label, :url]
132
+ @@page_link_attributes = [:linkable_id, :linkable_type, :position, :label, :url, :open_in_new_tab]
131
133
 
132
- @@page_section_attributes = [:type, :name, :position, :asset]
134
+ @@page_section_attributes = [:type, :name, :position, :asset, :text, :description]
133
135
 
134
136
  @@payment_attributes = [:amount, :payment_method_id, :payment_method]
135
137
 
136
138
  @@payment_method_attributes = [:name, :type, :description, :active, :display_on, :auto_capture, :position]
137
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
+
138
144
  @@product_properties_attributes = [:property_name, :property_id, :value, :position, :_destroy]
139
145
 
140
146
  @@product_attributes = [
@@ -207,7 +213,7 @@ module Spree
207
213
  @@stock_item_attributes = [:variant_id, :stock_location_id, :backorderable, :count_on_hand]
208
214
 
209
215
  @@stock_location_attributes = [
210
- :name, :active, :address1, :address2, :city, :zipcode,
216
+ :name, :active, :address1, :address2, :city, :zipcode, :company,
211
217
  :backorderable_default, :state_name, :state_id, :country_id, :phone,
212
218
  :propagate_all_variants
213
219
  ]
@@ -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.beta2
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-22 00:00:00.000000000 Z
13
+ date: 2025-05-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n-tasks
@@ -1158,6 +1158,7 @@ files:
1158
1158
  - db/migrate/20250418174652_add_resource_to_spree_role_users.rb
1159
1159
  - db/migrate/20250508060800_add_selected_locale_to_spree_admin_users.rb
1160
1160
  - db/migrate/20250509143831_add_session_id_to_spree_assets.rb
1161
+ - db/migrate/20250527134027_add_company_to_spree_stock_locations.rb
1161
1162
  - db/seeds.rb
1162
1163
  - lib/friendly_id/paranoia.rb
1163
1164
  - lib/generators/spree/authentication/custom/custom_generator.rb
@@ -1344,9 +1345,9 @@ licenses:
1344
1345
  - BSD-3-Clause
1345
1346
  metadata:
1346
1347
  bug_tracker_uri: https://github.com/spree/spree/issues
1347
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta2
1348
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta3
1348
1349
  documentation_uri: https://docs.spreecommerce.org/
1349
- source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta2
1350
+ source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta3
1350
1351
  post_install_message:
1351
1352
  rdoc_options: []
1352
1353
  require_paths: