In my ruby on rails application i have a class method in model which is combining two records
models/Client.rb
def self.get_clients
account = params[:user].current_account
account.clients + account.companies.map(&:clients).flatten
end
In controller i am using this method and applying kaminari paging on it
def index
Client.get_clients(params.merge(user: current_user)).page(params[:page]).per(10).unarchived
end
I am getting this error
undefined method `page' for #<Array:0xb6743220>
How can i convert this array to an active record ? or is there some other way to combine these records?