i have two tables
1)Properties :fields are id, name, propert_type,category_id
2)Admins : fields id, name,mobile,category_id
i want to write an active record to list all properties , where category_id in properties table and category_id in Admins table are equal
i am listing this property list by logging as admin.
i wrote active record like this , but i got error, can anyone please suggest me a solution for this
@properties= Property.where('properties.category_id=?','admins.category_id=?').and('admins.id=?',current_user.specific.id)
Aucun commentaire:
Enregistrer un commentaire