ActiveRecord Anonymous Class

As stated in #8934, using Anonymous Classes are not supported. That said, IF I were to use an anonymous class, what suggestions and concerns would you have? This is how I am using it currently

    tempConnection = Class::new(ActiveRecord::Base) do
def self.name
@name
end
end
tempConnection.instance_variable_set("@name","#{params[:database]}#{params[:table]}")
config = tempConnection.connection_config.clone
config[:database] = params[:database]
tempConnection.table_name = params[:table]
tempConnection.establish_connection(config)