How to get not exists set in collection in Rails -


i wanna set doesn't exists in collection. following:

ids = [1,2,3,4,5] # 2,3,4 not exists user.where(:id => ids) 

i want set [2,3,4]

without affecting performance,have solution?

use following:

ids - user.where(id: ids).select(:id).map(&:id) 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -