I have:
class ThingsCollection < ActiveRecord::Base
has_and_belongs_to_many :things, uniq: true
end
class Thing < ActiveRecord::Base
has_and_belongs_to_many :things_collections, uniq: true
end
I want to get Thing
s which don't have any ThingsCollection
s (thing.things_colllection_ids.empty? == true
). How can I do this via ActiveRecord & Squeel? (Without SQL query if possible)