Commit 8eab964e by ivan Lan

Fix query_spec_with_product of Series

parent 5a2e875a
......@@ -69,8 +69,8 @@ RSpec.describe "#{namespace}/products/:product_id/product_series", type: :reques
spec: {
type: :object,
properties: {
color: { type: :array },
size: { type: :array },
color: { type: :string },
size: { type: :string },
},
},
meta: {
......@@ -143,8 +143,8 @@ RSpec.describe "#{namespace}/products/:product_id/product_series", type: :reques
spec: {
type: :object,
properties: {
color: { type: :array },
size: { type: :array },
color: { type: :string },
size: { type: :string },
},
},
meta: {
......
......@@ -35,7 +35,7 @@ module Shotengai
if val.keys.sort == product.spec.keys.sort
keys = []; values = []
val.map { |k, v| keys << "spec->'$.\"#{k}\"' = ? "; values << v }
where(keys.join(' and '), *values)
where(product: product).where(keys.join(' and '), *values)
else
self.none
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment