Commit 020e2cd3 by vulehuan

fix error when using mongodb syntax in rails

parent d6fcc541
...@@ -68,8 +68,8 @@ class Product ...@@ -68,8 +68,8 @@ class Product
return Product.where(availability: 'instock') return Product.where(availability: 'instock')
.where(product_category_id: product_category_id) .where(product_category_id: product_category_id)
.where(id: { $ne: product_id })
.where(status: true) .where(status: true)
.excludes(id: product_id)
.desc(:created_at).desc(:updated_at).asc(:name) .desc(:created_at).desc(:updated_at).asc(:name)
.limit(limit) .limit(limit)
end 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