spree_core 0.50.3 → 0.50.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/product_group.rb +8 -4
- data/app/models/product_scope.rb +1 -1
- data/lib/spree_core/version.rb +1 -1
- metadata +3 -3
data/app/models/product_group.rb
CHANGED
@@ -90,10 +90,14 @@ class ProductGroup < ActiveRecord::Base
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def add_scope(scope_name, arguments=[])
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
if scope_name.to_s !~ /eval|send|system|[^a-z0-9_!?]/
|
94
|
+
self.product_scopes << ProductScope.new({
|
95
|
+
:name => scope_name.to_s,
|
96
|
+
:arguments => [*arguments]
|
97
|
+
})
|
98
|
+
else
|
99
|
+
raise ArgumentError.new("'#{scope_name}` can't be used as scope")
|
100
|
+
end
|
97
101
|
self
|
98
102
|
end
|
99
103
|
|
data/app/models/product_scope.rb
CHANGED
@@ -31,7 +31,7 @@ class ProductScope < ActiveRecord::Base
|
|
31
31
|
Product.send(self.name.intern, *array)
|
32
32
|
end
|
33
33
|
else
|
34
|
-
relation2 = Product.
|
34
|
+
relation2 = Product.metasearch({self.name.intern => array}).relation
|
35
35
|
end
|
36
36
|
unless another_scope.class == ActiveRecord::Relation
|
37
37
|
another_scope = another_scope.send(:relation)
|
data/lib/spree_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 223
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 50
|
9
|
-
-
|
10
|
-
version: 0.50.
|
9
|
+
- 4
|
10
|
+
version: 0.50.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Schofield
|