Skip to content

Commit

Permalink
Avoid referencing ActiveRecord::Base
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Dec 4, 2021
1 parent 99579bb commit f8e6917
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rails/generators/mobility/backend_generators/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8e6917

Please sign in to comment.