ruby on rails - How to get records from one table which are not in another table's fields (3) -


i want records table binaryfile binaryfile.id not in image.fullimage_id and not in image.preview_id and not in image.thumbnail_id

i tried following, records binaryfile not in image.fullimage_id or not in image.preview_id or not in image.thumbnail_id

binaryfiles = binaryfile.where('id not in (?)', [image.select("fullimage_id"), image.select("preview_id"), image.select("thumbnail_id")]) 

how can change condition or and?

binaryfile.where.not(id: image.pluck(:fullimage_id, :preview_id, :thumbnail_id).flatten) 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -