I need to add one more condition with AND
and !=
in this query
(i.e.: and properties.property_type_id != 'NULL')
How to add in this active record?
@properties = Property.where(category_id: Admin
.select("category_id").where(id: current_user.id))
Try this
@properties = Property.where("category_id IN (?) AND property_type_id IS NOT NULL", Admin.where(id: current_user.id).map(&:category_id) )
I hope this will help