- Implement list healing so that existing lists can be fixed up when implementing
positioned
or if the list somehow gets corrupted. - Tidy up Advisory Lock code.
- Implemented composite primary key support. Thanks @jackozi for the original PR and the nudge to get this done!
- Avoid unnecessary SQL queries when the position hasn't changed.
- Advisory Lock can now be optionally turned off via
advisory_lock: false
on yourpositioned
call. See the README for more details. Advisory Lock remains on by default. Thanks @joaomarcos96!
- When destroying a positioned item, first move it out of the way (position = 0) then contract the scope. Do this before destruction. Moving the item out of the way memoizes its original position to cope with the case where multiple items are destroyed with
destroy_all
as they'll have their position column cached. Thanks @james-reading for the report.
- Fetch the adapter_name from #connection_db_config (@tijn)
- Use
quote_table_name_for_assignment
inupdate_all
calls to guard against reserved word column names.
- Add an Advisory Lock to ensure isolation for the entirety of the create, update, and destroy cycles.
- Add SQLite Advisory Lock support using a file lock.
- Separated the Concern that is included into ActiveRecord::Base into its own submodule so that Mechanisms isn't also included.
- Added the RelativePosition Struct and documentation to make it easier to supply relative positions via form helpers.
- Allow the position to be passed as a JSON object so that we can pass in complex positions from the browser more easily.
- Allow empty strings to represent nil for the purposes of solidifying a position
- Fix bug relating to relative position hash coming from Rails being a Hash With Indifferent Access
- Internal refactoring of Mechanisms for clarity
- Additional unit testing of Mechanisms
- Added additional Ruby and Rails versions to the Github Actions matrix
- Fix a bug related to the scope changing with an explicitly set position value that is the same as the original position.
- Fix issues with STI based models
- Initial release