ransack icon indicating copy to clipboard operation
ransack copied to clipboard

Use built-in methods for nulls_first, nulls_last

Open stereobooster opened this issue 3 years ago • 6 comments

PR for #1373. PR not ready for merge - let's discuss. I didn't rename options or tests for now

Summary:

  • Works for all databases except MySQL in Rails 7
  • Works for PostgreSQL in Rails 6

stereobooster avatar Nov 12 '22 23:11 stereobooster

Related to https://github.com/activerecord-hackery/ransack/pull/1184

scarroll32 avatar Jan 29 '23 09:01 scarroll32

@stereobooster Makes sense to me to use built-in Rails methods, better than the other two options you presented at #1373. Can you do the necessary renamings/test fixes?

deivid-rodriguez avatar Jan 31 '23 13:01 deivid-rodriguez

@deivid-rodriguez yes I can. The problem is that it is kind of braking change. What shall I do about it?

stereobooster avatar Jan 31 '23 13:01 stereobooster

Can you explain the breaking change more? Is it because some supported Rails versions don't yet have these?

deivid-rodriguez avatar Jan 31 '23 13:01 deivid-rodriguez

Option is called postgres_fields_sort_option, but it would work for other databases as well. Shall I leave it as is?

stereobooster avatar Jan 31 '23 15:01 stereobooster

Oh, I didn't notice the option name. We'll be releasing Ransack 3 soon, we I'd rename the option since otherwise it's going to be very confusing.

deivid-rodriguez avatar Jan 31 '23 16:01 deivid-rodriguez