我有一個過濾問題,在我的情況,我需要通過值過濾器產品,其定位於兒童,但我只能使用當前版本中,我已經創建與去年協會通過Rails的爲最新的孩子和搜索由它的價值
has_one :product_current_version, -> { order version: :desc }, class_name: 'ProductVersion', foreign_key: :product_id
版本但當我嘗試使用
Product.joins(:product_current_version).where('product_current_versions.version = 6')
它返回錯誤
謝謝關注,我希望你能幫助我
什麼錯誤是什麼? – Iceman
#<產品:: ActiveRecord_Relation:0x312e94c> 只是在查詢中的錯誤 –
這不是一個錯誤信息 – Iceman