rails / arel

A Relational Algebra
2.06k stars 390 forks source link

Registering Visitors #529

Closed MariusDanner closed 6 years ago

MariusDanner commented 6 years ago

Hi, I'm trying to use Arel with SAP HANA and I am using this adapter. It is using this line to register itself to arel: Arel::Visitors::VISITORS['hana'] = Arel::Visitors::Hana in this file Unfortunately, you can't register new adapters this way since version 7.0. Is there any other possibility to register?

Thanks in advance

rafaelfranca commented 6 years ago

You don't need to register visitors. You only need to make sure your adapter use the right visitor. See https://github.com/rails/rails/blob/6717d6027ce7f6383baf6c78115debdbcf2348ac/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb#L812 as example