I have user model with :except_ids
scope:
scope :except_ids, ->(*ids) { where { id.not_in ids } }
The problem is - I can't use it with another lazy queries. For example, if I call something like this:
User.except_ids(User.except_ids(1,2))
I end up with
TypeError: Cannot visit Arel::SelectManager
I have much more complex query in my project, but everything works fine - except that scope. I can make it work by replacing scope by actual code, but that smells.
So, is there any way to find this out?