class Ransack::Adapters::ActiveRecord::Context

def extract_joins(association)

def extract_joins(association)
  parent = @join_dependency.instance_variable_get(:@join_root)
  reflection = association.reflection
  join_constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_1)
                       association.join_constraints_with_tables(
                         parent.table,
                         parent.base_klass,
                         Arel::Nodes::OuterJoin,
                         @join_dependency.instance_variable_get(:@alias_tracker),
                         @tables_pot[association]
                       )
                     else
                       association.join_constraints(
                         parent.table,
                         parent.base_klass,
                         Arel::Nodes::OuterJoin,
                         @join_dependency.instance_variable_get(:@alias_tracker)
                       )
                     end
  join_constraints.to_a.flatten
end