The problem is that the ordered_by_ancestry scope:
scope :ordered_by_ancestry, Proc.new { |order|
  if %w(mysql mysql2 sqlite sqlite3 postgresql).include?(connection.adapter_name.downcase) && ActiveRecord::VERSION::MAJOR >= 5
    reorder("coalesce(#{connection.quote_table_name(table_name)}.#{connection.quote_column_name(ancestry_column)}, '')", order)
  else
    reorder("(CASE WHEN #{connection.quote_table_name(table_name)}.#{connection.quote_column_name(ancestry_column)} IS NULL THEN 0 ELSE 1 END), #{connection.quote_table_name(table_name)}.#{connection.quote_column_name(ancestry_column)}", order)
  end
}
is passing a raw string of SQL to #reorder and, as the warning states, this is deprecated in Rails 5.2 (and will be removed altogether in Rails 6).
A pull request was just submitted which fixes this by wrapping those strings in Arel.sql calls. I'd expect this to merged quickly (despite the pull request missing an Arel.sql call in the second branch) but in the mean time, you have some options:
- Ignore the warning and wait for the gem to be patched. 
- Fork the gem, merge the pull request, and use your forked version until the gem merges the pull request in question. 
- Manually replace the - ordered_by_ancestryscope:
 - def self.ordered_by_ancestry(order)
  reorder(Arel.sql("coalesce(#{connection.quote_table_name(table_name)}.#{connection.quote_column_name(ancestry_column)}, '')"), order)
end
 - and wait for the pull request to get merged. 
UPDATE: The pull request which fixes this warning was just merged so there's no need to wait anymore, you should be able to grab the latest from GitHub and get on with more interesting things. Thanks to kbrock for sorting this out.