Not sure what you mean exactly. If you are asking about pluck vs. collect -- pluck causes issues on older ActiveRecord (3.2.8) and postgres when used in subselects. But then @operatingsystems is being used locally anyway, I'm not sure there's any point in using a subselect here (and other queries that needed fixes) in the first place.