Activerecord DISTINCT ON for json data type in postgresql

Hi Rails Core,

I would like to tackle https://github.com/rails/rails/issues/17706 , but I have some questions.

  1. Do we want the change? ( isolated ‘test’ https://gist.github.com/mess110/89f45de57fe8657da400 )

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:

Thanks,

Cristian