I have two sets of active records
users_by_type = User.where(type: 'customer')
Class of this is : users_by_type.class => Active Record Relation
users_by_tag = User.tagged_with('admin')
Class of this is : users_by_tag => ActiveRecord Relation
When I combine both sets like:
users = users_by_type + users_by_tag
or
users = users_by_type.merge(users_by_tag)
its give result as Array but I want it as Active Record Relation.
Class of users is: Array
Because in array, I am unable to use where clause and group clause.
How can I combine both sets so that I can use where and group clause?