spree_core 4.0.0.rc3 → 4.0.4

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: a92eeda37655c24a7921c434a9e7cef57121e16da3457279999d2011f898bea8
4
- data.tar.gz: 85dc63ab6533ea10eb138804558df376e33f1bfe24e0345d5209665a76c3b724
3
+ metadata.gz: db64342f32e3f2f8e7961e45d306348ddd82c3c2db66c06d5a80f6f17367b098
4
+ data.tar.gz: 8a5bb4027de95e826f19d23d73803b4fcf4395b5beedb8f5ae5a252ab273ea0c
5
5
  SHA512:
6
- metadata.gz: 368d97922da6dbda108e121097efce68a7393b556a0f3c0d8504db6158be11a42a1177d5a85e77c43d01d29de224f45666928a00ab0e3865274e44c0cb50b4fa
7
- data.tar.gz: 3298b2b794cae1e7c9b8653c581af1d7bb5077cc8a7b199644657b903597f807ec2c8cf2312f78a5a88f01d1c06905016dcd5948bdab77ec000b38ae7e0b79f0
6
+ metadata.gz: 31d55a0e769fdc0f9a58c3c31653f557c25a7fc02d4cfb870344a5a06cea1d8eb0369fee44b40ef1f19ec4e940a597ce859b726d81e12df400f43e7966cf0fc7
7
+ data.tar.gz: e2057c1a8c82ff57071dcf0be48e1fa15f600bb676892baf8cb931b1339edeacde7437b06d2663265e13740848e3f520fe018d40dd19261afae5cd4c5cbad2a5
@@ -143,7 +143,7 @@ module Spree
143
143
  end
144
144
 
145
145
  def include_discontinued(products)
146
- discontinued ? products : products.not_discontinued
146
+ discontinued ? products : products.available
147
147
  end
148
148
  end
149
149
  end
@@ -44,6 +44,10 @@ module Spree
44
44
  name.present?
45
45
  end
46
46
 
47
+ def name_matcher
48
+ Spree::Taxon.arel_table[:name].matches("%#{name}%")
49
+ end
50
+
47
51
  def by_ids(taxons)
48
52
  return taxons unless ids?
49
53
 
@@ -71,7 +75,7 @@ module Spree
71
75
  def by_name(taxons)
72
76
  return taxons unless name?
73
77
 
74
- taxons.where(name: name)
78
+ taxons.where(name_matcher)
75
79
  end
76
80
  end
77
81
  end
@@ -29,6 +29,17 @@ module Spree
29
29
 
30
30
  self.whitelisted_ransackable_associations = %w[bill_address ship_address]
31
31
  self.whitelisted_ransackable_attributes = %w[id email]
32
+
33
+ def self.with_address(query, address = :ship_address)
34
+ left_outer_joins(address).
35
+ where("#{Spree::Address.table_name}.firstname like ?", "%#{query}%").
36
+ or(left_outer_joins(address).where("#{Spree::Address.table_name}.lastname like ?", "%#{query}%"))
37
+ end
38
+
39
+ def self.with_email_or_addresses_ids(query, addresses_ids = [])
40
+ where('email LIKE ?', "%#{query}%").
41
+ or(where(id: addresses_ids))
42
+ end
32
43
  end
33
44
 
34
45
  # has_spree_role? simply needs to return true or false whether a user has a role or not.
@@ -617,6 +617,14 @@ module Spree
617
617
  end
618
618
  end
619
619
 
620
+ def valid_promotions
621
+ order_promotions.where(promotion_id: valid_promotion_ids).uniq(&:promotion_id)
622
+ end
623
+
624
+ def valid_promotion_ids
625
+ all_adjustments.eligible.nonzero.promotion.map { |a| a.source.promotion_id }.uniq
626
+ end
627
+
620
628
  private
621
629
 
622
630
  def link_by_email
@@ -11,7 +11,7 @@ module Spree
11
11
  products = updated_at(scope)
12
12
  products = price(products)
13
13
 
14
- products
14
+ products.distinct
15
15
  end
16
16
 
17
17
  private
@@ -43,7 +43,7 @@ module Spree
43
43
  private
44
44
 
45
45
  def current_tax_zone
46
- current_order.try(:tax_zone) || Spree::Zone.default_tax
46
+ @current_tax_zone ||= current_order.try(:tax_zone) || Spree::Zone.default_tax
47
47
  end
48
48
  end
49
49
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '4.0.0.rc3'
3
+ '4.0.4'
4
4
  end
5
5
  end
@@ -40,6 +40,7 @@ Gem::Specification.new do |s|
40
40
  s.add_dependency 'state_machines-activemodel', '~> 0.7'
41
41
  s.add_dependency 'stringex'
42
42
  s.add_dependency 'twitter_cldr', '~> 4.3'
43
+ s.add_dependency 'sprockets', '~> 3.7'
43
44
  s.add_dependency 'sprockets-rails'
44
45
  s.add_dependency 'mini_magick', '~> 4.9.4'
45
46
  s.add_dependency 'image_processing', '~> 1.2'
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.0.0.rc3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -314,6 +314,20 @@ dependencies:
314
314
  - - "~>"
315
315
  - !ruby/object:Gem::Version
316
316
  version: '4.3'
317
+ - !ruby/object:Gem::Dependency
318
+ name: sprockets
319
+ requirement: !ruby/object:Gem::Requirement
320
+ requirements:
321
+ - - "~>"
322
+ - !ruby/object:Gem::Version
323
+ version: '3.7'
324
+ type: :runtime
325
+ prerelease: false
326
+ version_requirements: !ruby/object:Gem::Requirement
327
+ requirements:
328
+ - - "~>"
329
+ - !ruby/object:Gem::Version
330
+ version: '3.7'
317
331
  - !ruby/object:Gem::Dependency
318
332
  name: sprockets-rails
319
333
  requirement: !ruby/object:Gem::Requirement
@@ -1049,7 +1063,7 @@ homepage: http://spreecommerce.org
1049
1063
  licenses:
1050
1064
  - BSD-3-Clause
1051
1065
  metadata: {}
1052
- post_install_message:
1066
+ post_install_message:
1053
1067
  rdoc_options: []
1054
1068
  require_paths:
1055
1069
  - lib
@@ -1064,8 +1078,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1064
1078
  - !ruby/object:Gem::Version
1065
1079
  version: 1.8.23
1066
1080
  requirements: []
1067
- rubygems_version: 3.0.2
1068
- signing_key:
1081
+ rubygems_version: 3.1.4
1082
+ signing_key:
1069
1083
  specification_version: 4
1070
1084
  summary: The bare bones necessary for Spree.
1071
1085
  test_files: []