Activerecord DISTINCT ON for json data type in postgresql

Hi Rails Core,

I would like to tackle , but I have some questions.

  1. Do we want the change? ( isolated ‘test’ )

If we do,

  1. Is the suggested approach good? (the one in the issue)

  2. I was looking though the tests and I found 2 places where it could fit. Which is better?

  3. rails/activerecord/test/cases/adapters/postgresql/json_test.rb (json related tests)

  4. rails/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb (distinct related tests)

  5. Going though the docs, I found: