jeremyevans / sequel

Sequel: The Database Toolkit for Ruby
http://sequel.jeremyevans.net
Other
5k stars 1.07k forks source link

Honor configured `:top` option for empty lists #2115

Closed johanmagnusson closed 11 months ago

johanmagnusson commented 11 months ago

Using the list plugin with the option :top set to something other than the default (1) is causing discrepancies when adding a new element to an empty list without providing a specific position value. The plugin will always set the start value to 1 and ignore the configured top option.

This PR will make the list plugin honor the configured top option when the first item in the list is added when the position value is not provided.

jeremyevans commented 11 months ago

Thanks for the patch! I agree this is a bug and the fix looks good.