From f8e6917cb951ed75c24af365d49d4a2544c31b7e Mon Sep 17 00:00:00 2001 From: Chris Salzberg Date: Fri, 3 Dec 2021 21:53:04 +0900 Subject: [PATCH] Avoid referencing ActiveRecord::Base --- lib/rails/generators/mobility/backend_generators/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rails/generators/mobility/backend_generators/base.rb b/lib/rails/generators/mobility/backend_generators/base.rb index c098346bd..8e2cfb90d 100644 --- a/lib/rails/generators/mobility/backend_generators/base.rb +++ b/lib/rails/generators/mobility/backend_generators/base.rb @@ -46,7 +46,9 @@ def data_source_exists? connection.data_source_exists?(table_name) end - delegate :connection, to: ::ActiveRecord::Base + def connection + ::ActiveRecord::Base.connection + end def truncate_index_name(index_name) if index_name.size < connection.index_name_length