什麼是正確的語法,來查詢所有者不是CURRENT_USER:什麼是對紅寶石不平等的語法,其中查詢
.where(owner_id: != current_user.id, recipient_id: current_user.id, owner_type: "User")
我嘗試這樣做:
where(['current_user.id <> ?', :owner_id ], recipient_id: current_user.id, owner_type: "User")
,並得到:
undefined method `%' for ["current_user.id <> ?", :owner_id]:Array
你試過'這裏( 'owner_id!=?',current_user.id)'? – Huy