spree_core 4.1.0.rc2 → 4.1.0.rc3

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: bdc19a0196b06913c237d25f4e45315ea03abf5a5b30e5e660440339daf7e5f0
4
- data.tar.gz: c5d95ff6a5ca995ae81ee67ffbfe8b17a09a24afd5f83cfa5e7fc1a3b19a1fb9
3
+ metadata.gz: 7062a9bb28afea833ef56e653f7f974eaf33f6d10c352c407beea07910ed2b7e
4
+ data.tar.gz: 0effc4f253609ec14cd29109e21161b44cb92af1c1a53840f24bd27dae5fd0d8
5
5
  SHA512:
6
- metadata.gz: '098925f7a1dc32e87a5a1a0798b13a7983d86a1fe5cb8f2f20f9ffb50eb0098c79785e81c849d1137bba1362d01edfd9fe3cdf904092943c3a354f47a057ec3c'
7
- data.tar.gz: 8f052c9cc5437ad254105c6e5236968a81c7dd5c1f8af4fd086f97bf684784b3b64f7aaeae317a1840225931848958f7007ae6ffc1b63b319d820062b2cb8cab
6
+ metadata.gz: 5024b7281e7cfa97efbb104d6f243d9783d36288d5dfe8e91a8ebe14a52e04bc61f78e7cf8a3765224d8a9a7ea4e18d218b0e9d924c12b111a629544ed36ddf9
7
+ data.tar.gz: dc6c98bf3679d2997e966f1efc671d87523fb994650fdff5968ed2c52523171a60c9b406f93c645bb34a52a1c5fbfc9215d1f574bc52a955082f54fba255cb3c
@@ -127,8 +127,8 @@ module Spree
127
127
  limit(Spree::Config[:products_per_page])
128
128
  end
129
129
 
130
- def product_available_in_currency?(product)
131
- !(product.price_in(current_currency).amount.nil? || product.price_in(current_currency).amount.zero?)
130
+ def product_available_in_currency?
131
+ !(@product_price.nil? || @product_price.zero?)
132
132
  end
133
133
 
134
134
  def common_product_cache_keys
@@ -147,7 +147,7 @@ module Spree
147
147
  @_variants_option_types_presenter ||= begin
148
148
  option_types = Spree::Variants::OptionTypesFinder.new(variant_ids: variants.map(&:id)).execute
149
149
 
150
- Spree::Variants::OptionTypesPresenter.new(option_types)
150
+ Spree::Variants::OptionTypesPresenter.new(option_types, variants)
151
151
  end
152
152
  end
153
153
  end
@@ -4,11 +4,11 @@ module Spree
4
4
  belongs_to :variant, class_name: 'Spree::Variant'
5
5
  belongs_to :order, class_name: 'Spree::Order'
6
6
  belongs_to :shipment, class_name: 'Spree::Shipment', touch: true, optional: true
7
- belongs_to :return_authorization, class_name: 'Spree::ReturnAuthorization'
7
+ has_many :return_items
8
+ has_many :return_authorizations, class_name: 'Spree::ReturnAuthorization', through: :return_items
8
9
  belongs_to :line_item, class_name: 'Spree::LineItem'
9
10
  end
10
11
 
11
- has_many :return_items, inverse_of: :inventory_unit
12
12
  belongs_to :original_return_item, class_name: 'Spree::ReturnItem'
13
13
 
14
14
  scope :backordered, -> { where state: 'backordered' }
@@ -21,6 +21,7 @@ module Spree
21
21
 
22
22
  validates :name, presence: true, uniqueness: { scope: [:parent_id, :taxonomy_id], allow_blank: true, case_sensitive: false }
23
23
  validates :permalink, uniqueness: { case_sensitive: false }
24
+ validates :hide_from_nav, inclusion: { in: [true, false] }
24
25
  validates_associated :icon
25
26
  validate :check_for_root, on: :create
26
27
  with_options length: { maximum: 255 }, allow_blank: true do
@@ -1,8 +1,9 @@
1
1
  module Spree
2
2
  module Variants
3
3
  class OptionTypesPresenter
4
- def initialize(option_types)
4
+ def initialize(option_types, variants)
5
5
  @option_types = option_types
6
+ @variant_ids = variants.map(&:id)
6
7
  end
7
8
 
8
9
  def default_variant
@@ -43,7 +44,7 @@ module Spree
43
44
 
44
45
  def find_variant_data(&block)
45
46
  option_types.first.option_values.each do |option_value|
46
- variant = option_value.variants.find(&block)
47
+ variant = option_value.variants.where(id: @variant_ids).find(&block)
47
48
 
48
49
  return { variant: variant, option_value: option_value } if variant
49
50
  end
@@ -53,7 +54,7 @@ module Spree
53
54
 
54
55
  def find_first_variant_data
55
56
  option_value = option_types.first.option_values.first
56
- variant = option_value.variants.first
57
+ variant = option_value.variants.where(id: @variant_ids).first
57
58
 
58
59
  { variant: variant, option_value: option_value }
59
60
  end
@@ -64,7 +65,7 @@ module Spree
64
65
  id: option_value.id,
65
66
  position: option_value.position,
66
67
  presentation: option_value.presentation,
67
- variant_id: option_value.variants.first.id,
68
+ variant_id: option_value.variants.where(id: @variant_ids).first.id,
68
69
  is_default: option_value == default_variant_data[:option_value]
69
70
  }
70
71
  end
@@ -635,7 +635,7 @@ en:
635
635
  cart_page:
636
636
  add_promo_code: ADD PROMO CODE
637
637
  checkout: checkout
638
- empty_info: 'Your cart is empty.<br />There are no items in your cart.'
638
+ empty_info: 'Your cart is empty.'
639
639
  header: Your shopping bag
640
640
  product: product
641
641
  quantity: quantity
@@ -767,7 +767,7 @@ en:
767
767
  dismiss_banner: No. Thanks! I'm not interested, do not display this message again
768
768
  display: Display
769
769
  doesnt_track_inventory: It doesn't track inventory
770
- dont_have_account: Don't have an account yet?
770
+ dont_have_account: No account?
771
771
  edit: Edit
772
772
  editing_resource: 'Editing %{resource}'
773
773
  editing_rma_reason: Editing RMA Reason
@@ -864,6 +864,7 @@ en:
864
864
  guest_user_account: Checkout as a Guest
865
865
  has_no_shipped_units: has no shipped units
866
866
  height: Height
867
+ hide_from_subcategories_nav: Hide from subcategories navigation
867
868
  home: Home
868
869
  homepage:
869
870
  bestsellers: BESTSELLERS
@@ -1212,7 +1213,7 @@ en:
1212
1213
  not_found_filters2: Please try another choose.
1213
1214
  not_found_text1: We couldn’t find products for '%{keywords}'.
1214
1215
  not_found_text2: Please try another search.
1215
- price: PRICE
1216
+ price: Price
1216
1217
  price_high_to_low: PRICE (HIGH - LOW)
1217
1218
  price_low_to_high: PRICE (LOW - HIGH)
1218
1219
  result: RESULT
@@ -1350,6 +1351,7 @@ en:
1350
1351
  rename: Rename
1351
1352
  report: Report
1352
1353
  reports: Reports
1354
+ required: '*'
1353
1355
  required_fields: required fields
1354
1356
  resellable: Resellable
1355
1357
  resend: Resend
@@ -0,0 +1,5 @@
1
+ class AddHideFromNavToTaxons < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :spree_taxons, :hide_from_nav, :boolean, default: false, index: true
4
+ end
5
+ end
@@ -19,11 +19,11 @@ default:
19
19
  promo_banners:
20
20
  - subtitle: New collection
21
21
  title: Summer 2019
22
- url: /t/summer-collection
22
+ url: /t/new-collection/summer-2019
23
23
  image: 'meganav/promo_banner_left-first-category.jpg'
24
24
  - subtitle: Special Offers
25
25
  title: Get up to 30% off
26
- url: /t/special-offers
26
+ url: /t/special-offers/30-off
27
27
  image: 'meganav/promo_banner_right-first-category.jpg'
28
28
  - title: Men
29
29
  subtitle: Categories
@@ -40,11 +40,11 @@ default:
40
40
  promo_banners:
41
41
  - subtitle: New collection
42
42
  title: Summer 2019
43
- url: /t/summer-collection
43
+ url: /t/new-collection/summer-2019
44
44
  image: 'meganav/promo_banner_left-second-category.jpg'
45
45
  - subtitle: Special Offers
46
46
  title: Get up to 30% off
47
- url: /t/special-offers
47
+ url: /t/special-offers/30-off
48
48
  image: 'meganav/promo_banner_right-second-category.jpg'
49
49
  - title: Sportswear
50
50
  subtitle: Categories
@@ -59,9 +59,9 @@ default:
59
59
  promo_banners:
60
60
  - subtitle: New collection
61
61
  title: Summer 2019
62
- url: /t/summer-collection
62
+ url: /t/new-collection/summer-2019
63
63
  image: 'meganav/promo_banner_left-third-category.jpg'
64
64
  - subtitle: Special Offers
65
65
  title: Get up to 30% off
66
- url: /t/special-offers
66
+ url: /t/special-offers/30-off
67
67
  image: 'meganav/promo_banner_right-third-category.jpg'
@@ -36,7 +36,7 @@ module Spree
36
36
  def extended_base_scope
37
37
  base_scope = Spree::Product.spree_base_scopes.active
38
38
  base_scope = get_products_conditions_for(base_scope, keywords)
39
- base_scope = Spree::Products::Find.new(
39
+ base_scope = Spree::Dependencies.products_finder.constantize.new(
40
40
  scope: base_scope,
41
41
  params: {
42
42
  filter: {
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '4.1.0.rc2'
3
+ '4.1.0.rc3'
4
4
  end
5
5
  end
@@ -105,8 +105,8 @@ module Spree
105
105
  @@taxonomy_attributes = [:name]
106
106
 
107
107
  @@taxon_attributes = [
108
- :name, :parent_id, :position, :icon, :description, :permalink, :taxonomy_id,
109
- :meta_description, :meta_keywords, :meta_title, :child_index
108
+ :name, :parent_id, :position, :icon, :description, :permalink, :hide_from_nav,
109
+ :taxonomy_id, :meta_description, :meta_keywords, :meta_title, :child_index
110
110
  ]
111
111
 
112
112
  # TODO: Should probably use something like Spree.user_class.attributes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0.rc2
4
+ version: 4.1.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2020-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -945,6 +945,7 @@ files:
945
945
  - db/migrate/20191005121504_add_store_id_to_payment_methods.rb
946
946
  - db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb
947
947
  - db/migrate/20200102141311_add_social_to_spree_stores.rb
948
+ - db/migrate/20200212144523_add_hide_from_nav_to_taxons.rb
948
949
  - db/seeds.rb
949
950
  - lib/friendly_id/slug_rails5_patch.rb
950
951
  - lib/generators/spree/custom_user/custom_user_generator.rb