1
在我的Rails應用程序中,我試圖從Postgres獲取一組記錄,然後在應用程序中顯示它們。一個看起來像這樣:Postgres運營商不在與回形針的Rails應用程序工作
<% featured = Product.order('RANDOM()').limit(3).where.not(photo_file_name: nil, sold_value: true) %>
這工作正常,但另一個在另一個實例它沒有。這裏:
<% recentlistings = Product.order('created_at DESC').limit(3).where.not(user_id: current_user.id, photo_file_name: nil, sold_value: true) %>
如果我刪除了photo_file_name
運算符,它工作正常。任何理由爲什麼這可能是?
愚蠢的錯誤,這是由於在開發模式中不當前的用戶標準 – 2014-12-07 00:24:26