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 +4 -4
- data/app/finders/spree/products/find.rb +1 -1
- data/app/finders/spree/taxons/find.rb +5 -1
- data/app/models/concerns/spree/user_methods.rb +11 -0
- data/app/models/spree/order.rb +8 -0
- data/app/sorters/spree/products/sort.rb +1 -1
- data/lib/spree/core/controller_helpers/store.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/spree_core.gemspec +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db64342f32e3f2f8e7961e45d306348ddd82c3c2db66c06d5a80f6f17367b098
|
4
|
+
data.tar.gz: 8a5bb4027de95e826f19d23d73803b4fcf4395b5beedb8f5ae5a252ab273ea0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31d55a0e769fdc0f9a58c3c31653f557c25a7fc02d4cfb870344a5a06cea1d8eb0369fee44b40ef1f19ec4e940a597ce859b726d81e12df400f43e7966cf0fc7
|
7
|
+
data.tar.gz: e2057c1a8c82ff57071dcf0be48e1fa15f600bb676892baf8cb931b1339edeacde7437b06d2663265e13740848e3f520fe018d40dd19261afae5cd4c5cbad2a5
|
@@ -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(
|
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.
|
data/app/models/spree/order.rb
CHANGED
@@ -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
|
data/lib/spree/core/version.rb
CHANGED
data/spree_core.gemspec
CHANGED
@@ -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.
|
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:
|
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.
|
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: []
|