How to copy model with arel_table instance

Hi all

I want to make copy of current scoped object, then change some stuff in arel_table(i need to change table_alias, because i have complicated query) and arel(SelectManager)

def self.do_smth

query = scoped.dup

puts query.arel_table.object_id == scoped.arel_table.object_id # true


Theoretically i can dup arel(SelectManager) but i can not find how to add table alias to that instance

If i do this with scoped.dup then i get error, because i changed table_alias and rest of queries use that arel_table for request