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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -