All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Use
.with_connection do |connection|
where possible instead of.connection
#441 ([flood4life])
- Updated .gemspec to exclude unnecessary files from the gem package. #437 ([f440])
- We no longer delegate the class
connection
method to the instance. #436 ([davidcelis])
- Add support for composite primary keys. #430 ([divagueame])
- Refactored CI testing framework and removed the Appraisals gem. Use RAILS_VERSION to switch the Rails version you are currently running the tests against.
- We now only explicitly test against Rails 6.1+ and Ruby 3.0+.
- Use
after_save
instead ofafter_commit
forclear_scope_changed
callback #407 (@Flixt) - Rename
add_to_list_top
andadd_to_list_bottom
private methods toavoid_collision
that handles both cases as well as the case where:add_new_at
isnil
. Setting an explicit position when:add_new_at
isnil
will now shuffle other items out of the way if necessary. This may break existing workarounds you have in place to deal with this bug. #411. ([brendon])
- Add Tests ruby 2.7 and 3.0 #393 ([QWYNG])
- Silence deprecation warnings in Rails 6 #384 ([h-lame])
- Add explicit requirement of ActiveSupport::Inflector #387 ([rdvdijk])
- gemspec: Drop defunct
rubyforge_project
directive #373 (olleolleolle)
- Invert order when incrementing to circumvent unique index violations (#368)
v1.0.0 - 2019-09-26
- BREAKING CHANGE: Support for Rails 3.2 > 4.1 has been removed. 0.9.19 is the last version that supports these Rails versions
- Added Troubleshooting Database Deadlock Errors section to
README.md
- Added support for Rails 6.0 in testing
- Various README fixes
- A new method called
current_position
now exists and returns the integer position of the item it's called on, ornil
if the position isn't set.
v0.9.19 - 2019-03-12
- Allow
acts_as_list_no_update
blocks to be nested @conorbdaly
v0.9.18 - 2019-03-08
- Added additional gemspec metadata @boone
- Add gem version badge to README @joshuapinter
- Add touch on update configuration @mgbatchelor
- Let's start a new direction with the CHANGELOG file @mainameiz
- Fix sqlite3 gem pinning breaking tests
v0.9.17 (2018-10-29)
Closed issues:
- Inconsistent behavior #330
- Using
top\_of\_list
set to 1 and setting a record to index 0 triggers aPG::UniqueViolation
#322
Merged pull requests:
- Feature/add exception to wrong position #323 (TheNeikos)
- Methods move_to_bottom and move_to_top should not fail when there are unique constraints #320 (faucct)
v0.9.16 (2018-08-30)
Closed issues:
- Re-ordering at specific position #318
no\_update
is not applied to subclasses #314- NoMethodError: undefined method `acts_as_list' #303
- Cannot create item at position 0 #297
Merged pull requests:
v0.9.15 (2018-06-11)
Merged pull requests:
- Fix #314:
no\_update
is not applied to subclasses #315 (YoranBrondsema)
v0.9.14 (2018-06-05)
Closed issues:
insert\_at
saves invalid ActiveRecord objects #311
Merged pull requests:
- #311 Don't insert invalid ActiveRecord objects #312 (seanabrahams)
v0.9.13 (2018-06-05)
Merged pull requests:
v0.9.12 (2018-05-02)
Closed issues:
- acts_as_list methods on has_many through #308
- Travis badge #307
- Unscoping breaks STI subclasses, but is soon to be fixed in Rails #291
- Refactor string eval for scope_condition #227
Merged pull requests:
- mocha/minitest, not mocha/mini_test now. #310 (jmarkbrooks)
v0.9.11 (2018-03-19)
Closed issues:
- Setting
position: nil
on update returnsColumn 'position' cannot be null
instead of putting the item at the start or the end of the list, like it does on create. #302 - Switching to Semaphore #301
- Dropping jruby support #300
- Rails 5.2.0 #299
- Cannot update record position when scoped to enum #298
add\_new\_at: :top
does not work #296- remove_from_list causing "wrong number of arguments (given 2, expected 0..1)" #293
- Passing raw strings to reorder deprecated in Rails 5.2 #290
Merged pull requests:
- Fix Test Suite #306 (brendon)
- Add frozen_string_literal pragma to ruby files #305 (krzysiek1507)
- Use symbols instead of SQL strings for reorder (for Rails 5.2) #294 (jhawthorn)
v0.9.10 (2017-11-19)
Closed issues:
- Make insert_at respect position when creating a new record #287
- Why does acts_as_list override rails validation on it's own field? #269
Merged pull requests:
- Change error classes parents #288 (alexander-lazarov)
v0.9.9 (2017-10-03)
Merged pull requests:
v0.9.8 (2017-09-28)
Closed issues:
- Deadlocking in update_positions count query #285
- Updating the position fails uniqueness constraint. #275
v0.9.7 (2017-07-06)
v0.9.6 (2017-07-05)
Closed issues:
- undefined method `+' for nil:NilClass #278
- Enum does not scope correctly #277
- Can we don't use remove_from_list when destroy a lot objects? #276
- The NoUpdate code rely's on AS::Concern #273
- ActiveRecord associations are no longer required (even though belongs_to_required_by_default == true) #268
- Unique constraint violation on move_higher, move_lower, destroy #267
Merged pull requests:
- Fix Fixnum deprecation warnings. #282 (patrickdavey)
- Fix update to scope that was defined with an enum #281 (scottmalone)
- Refactor update_all_with_touch #279 (ledestin)
- Remove AS::Concern from NoUpdate #274 (brendon)
- Use
ActiveSupport.on\_load
to hook into ActiveRecord #272 (brendon)
v0.9.5 (2017-04-04)
Closed issues:
- acts_as_list_class.maximum(position_column) is causing the entire table to lock #264
- Be more precise with unscope-ing #263
Merged pull requests:
- Use bottom_position_in_list instead of the highest value in the table #266 (brendon)
- Be more surgical about unscoping #265 (brendon)
v0.9.4 (2017-03-16)
Merged pull requests:
- Optimize first? and last? instance methods. #262 (marshall-lee)
v0.9.3 (2017-03-14)
Closed issues:
- Rails 5.1.0.beta1 deprecation #257
- Move item X after item Y #256
- Is there way to specify the position when creating a resource? #255
Merged pull requests:
- Don't update a child destroyed via relation #261 (brendon)
- No update list for collection classes #260 (IlkhamGaysin)
- Fix deprecation introduced in ActiveRecord 5.1.0.beta1. Closes #257 #259 (CvX)
- Refactor column definer module #258 (ledestin)
v0.9.2 (2017-02-07)
Closed issues:
- Getting invalid input syntax for uuid #253
v0.9.1 (2017-01-26)
Closed issues:
- DEPRECATION WARNING on rails 5.0 as of acts_as_list 0.9 #251
- higher_items returns items with the same position value #247
- Broken with unique constraint on position #245
Merged pull requests:
- fixes #251 table_exists? deprecation warning with Rails 5.0 #252 (zharikovpro)
v0.9.0 (2017-01-23)
Closed issues:
- warning: too many arguments for format string #239
- Broken tests related to time comparison #238
- Shuffling positions is halting the callback chain #234
- Reorder positions #233
- Tests break when upgrading from 0.7.2 to 0.7.4 #228
- RE #221 needing a test #226
- Adding to existing model with data and methods don't work #209
- Position is set incorrectly when circular dependencies exist #153
Merged pull requests:
- Revert "Updates documentation with valid string interpolation syntax" #250 (brendon)
- Updates documentation with valid string interpolation syntax #249 (naveedkakal)
- Comply to tests warnings #248 (randoum)
- insert_at respects unique not null check (>= 0) db constraints #246 (zharikovpro)
- acts_as_list_no_update #244 (randoum)
- Update README.md #243 (rahuldstiwari)
- Fixed tests to prevent warning: too many arguments for format string #242 (brendon)
- Be explicit about ordering when mapping :pos #241 (brendon)
- Improve load method #240 (brendon)
- Fix non regular sequence movement #237 (tiagotex)
- Add travis config for testing against multiple databases #236 (fschwahn)
- Extract modules #229 (ledestin)
v0.8.2 (2016-09-23)
Closed issues:
- We're a repo now, no longer a fork attached to rails/acts_as_list #232
- Break away from rails/acts_as_list #224
- Problem when inserting straight at top of list #109
Merged pull requests:
- Show items with same position in higher and lower items #231 (jpalumickas)
- fix setting position when previous position was nil #230 (StoneFrog)
v0.8.1 (2016-09-06)
Closed issues:
- Rubinius Intermittent testing error #218
- ActiveRecord dependency causes rake assets:compile to fail without access to a database #84
Merged pull requests:
v0.8.0 (2016-08-23)
Closed issues:
- Behavior with DB default seems unclear #219
Merged pull requests:
- No longer a need specify additional rbx gems #225 (brendon)
- Fix position when no serial positions #223 (jpalumickas)
- Bug: Specifying a position with add_new_at: :top fails to insert at that position #220 (brendon)
v0.7.7 (2016-08-18)
Closed issues:
- Issue after upgrading to 0.7.5: No connection pool with id primary found. #214
- Changing scope is inconsistent based on add_new_at #138
- Duplicate positions and lost items #76
Merged pull requests:
- Add quoted table names to some columns #221 (jpalumickas)
- Appraisals cleanup #217 (brendon)
- Fix insert_at_position in race condition #195 (danielross)
v0.7.6 (2016-07-15)
Closed issues:
- add_new_at nil with scope causes NoMethodError #211
Merged pull requests:
- Add class method acts_as_list_top as reader for configured top_of_list #213 (krzysiek1507)
- Bugfix/add new at nil on scope change #212 (greatghoul)
v0.7.5 (2016-06-30)
Implemented enhancements:
- Touch when reordering #173 (botandrose)
Closed issues:
- Exception raised when calling destroy "NameError - instance variable @scope_changed not defined:" #206
- Undefined instance variable @scope_changed since 0.7.3 #199
- Reordering large lists is slow #198
- Reparenting child leaves gap in source list in rails 5 #194
- Support rails 5 ? #186
- I get a NoMethodError: undefined method `acts_as_list' when trying to include acts_as_list #176
- Phenomenon of mysterious value of the position is skipped by one #166
- Model.find being called twice with acts_as_list on destroy #161
scope\_changed?
problem with acts_as_paranoid #158- Inconsistent behaviour between Symbol and Array scopes #155
- insert_at doesn't seem to be working in ActiveRecord callback (Rails 4.2) #150
- Project Documentation link redirects to expired domain #149
- Problem when updating an position of array of AR objects. #137
- Unexpected behaviour when inserting consecutive items with default positions #124
- self.reload prone to error #122
- Rails 3.0.x in_list causes the return of default_scope #120
- Relationships with dependency:destroy cause ActiveRecord::RecordNotFound #118
- Using insert_at with values with type String #117
- Batch setting of position #112
- position: 0 now makes model pushed to top? #110
- Create element in default position #103
- Enhancement: Expose scope object #97
- Shuffle list #96
- Creating an item with a nil scope should not add it to the list #92
- Performance Improvements #88
- has_many :through or has_many_and_belongs_to_many support #86
- move_higher/move_lower vs move_to_top/move_to_bottom act differently when item is already at top or bottom #77
- Limiting the list size #61
- Adding multiple creates strange ordering #55
- Feature: sort #26
Merged pull requests:
- Fix position when no serial positions #208 (PoslinskiNet)
- Removed duplicated assignment #207 (shunwen)
- Quote all identifiers #205 (fabn)
- Start testing Rails 5 #203 (brendon)
- Lock! the record before destroying #201 (brendon)
- Fix ambiguous column error when joining some relations #180 (natw)
v0.7.4 (2016-04-15)
Closed issues:
- Releasing a new gem version #196
Merged pull requests:
v0.7.3 (2016-04-14)
v0.7.2 (2016-04-01)
Closed issues:
- DEPRECATION WARNING: Passing string to define callback on Rails 5 beta 3 #191
- Why is
add\_to\_list\_bottom
private? #187 - Ordering of children when there are two possible parent models. #172
- Fix the jruby and rbx builds #169
- Unable to run tests #162
- shuffle_positions_on_intermediate_items is creating problems #134
- introduce Changelog file to quickly track changes #68
- Mongoid support? #52
Merged pull requests:
- Add filename/line number to class_eval call #193 (hfwang)
- Use a symbol as a string to define callback #192 (brendon)
- Pin changelog generator to a working version #190 (fabn)
- Fix bug, position is recomputed when object saved #188 (chrisortman)
- Update bundler before running tests, fixes test run on travis #179 (fabn)
- Changelog generator, closes #68 #177 (fabn)
- Updating README example #175 (ryanbillings)
- Adds description about various options available with the acts_as_list method #168 (udit7590)
- Small changes to DRY up list.rb #163 (Albin-Willman)
- Only swap changed attributes which are persistable, i.e. are DB columns. #152 (ludwigschubert)
0.7.2 (2015-05-06)
0.7.1 (2015-05-06)
Merged pull requests:
0.7.0 (2015-05-01)
Closed issues:
- Problem with reordering scoped list items #154
- Can no longer load acts_as_list in isolation if Rails is installed #145
Merged pull requests:
- Fix regression with using acts_as_list on base classes #147 (botandrose)
- Don't require rails when loading #146 (botandrose)
0.6.0 (2014-12-24)
Closed issues:
- Deprecation Warning: sanitize_sql_hash_for_conditions is deprecated and will be removed in Rails 5.0 #143
- Release a new gem version #136
Merged pull requests:
- Fix sanitize_sql_hash_for_conditions deprecation warning in Rails 4.2 #140 (eagletmt)
- Simpler method to find the subclass name #139 (brendon)
- Rails4 enum column support #130 (arunagw)
- use eval for determining the self.class.name useful when this is used in an abstract class #123 (flarik)
0.5.0 (2014-10-31)
Closed issues:
- I want to have my existing records works like list #133
- Add Support For Multiple Indexes #127
- changing parent_id does not update item positions #126
- How to exclude objects to be positioned? #125
- Scope for Polymorphic association + ManyToMany #106
- Bug when use #insert_at on an invalid ActiveRecord object #99
- has_many :through with acts as list #95
- Update position when scope changes #19
Merged pull requests:
- Cast column default value to int before comparing with position column #129 (wioux)
- Fix travis builds for rbx #128 (meineerde)
- Use unscoped blocks instead of chaining #121 (brendon)
- Make acts_as_list more compatible with BINARY column #116 (sikachu)
- Added help notes on non-association scopes #115 (VorontsovIE)
- Let AR::Base properly lazy-loaded if Railtie is available #114 (amatsuda)
0.4.0 (2014-02-22)
Closed issues:
- insert_at creates gaps #108
- move_lower and move_higher not working returning nil #57
- Mass-assignment issue with 0.1.8 #50
- validates error #49
- Ability to move multiple at once #40
- Duplicates created when using accepts_nested_attributes_for #29
Merged pull requests:
- Update README #107 (Senjai)
- Add license info: license file and gemspec #105 (chulkilee)
- Fix top position when position is lower than top position #104 (csaura)
- Get specs running under Rails 4.1.0.beta1 #101 (petergoldstein)
- Add support for JRuby and Rubinius specs #100 (petergoldstein)
- Use the correct syntax for conditions in Rails 4 on the readme. #94 (gotjosh)
- Adds
required\_ruby\_version
to gemspec #90 (tvdeyen)
0.3.0 (2013-08-02)
Closed issues:
- act_as_list didn't install with bundle install #83
- Cannot update to version 0.1.7 #48
- when position is null all new items get inserted in position 1 #41
Merged pull requests:
- Test against activerecord v3 and v4 #82 (sanemat)
- Fix check_scope to work on lists with array scopes #81 (conzett)
- Rails4 compatibility #80 (philippfranke)
- Add tests for moving within scope and add method: move_within_scope #79 (philippfranke)
- Option to not automatically add items to the list #72 (forrest)
0.2.0 (2013-02-28)
Merged pull requests:
- Fix update_all deprecation warnings in Rails 4.0.0.beta1 #73 (soffes)
- Add quotes to Id in SQL requests #69 (noefroidevaux)
- Update position when scope changes #67 (philippfranke)
- add and categorize public instance methods in readme; add misc notes to ... #66 (barelyknown)
- Updates #bottom_item .find syntax to >= Rails 3 compatible syntax. #65 (tvdeyen)
- add GitHub Flavored Markdown to README #63 (phlipper)
0.1.9 (2012-12-04)
Closed issues:
Merged pull requests:
- attr-accessible can be damaging, is not always necessary. #60 (graemeworthy)
- More reliable lower/higher item detection #59 (miks)
- Instructions for using an array with scope #58 (zukowski)
- Attr accessible patch, should solve #50 #51 (fabn)
- support accepts_nested_attributes_for multi-destroy #46 (saberma)
0.1.8 (2012-08-09)
0.1.7 (2012-08-09)
Closed issues:
Merged pull requests:
- Fixed issue with update_positions that wasn't taking 'scope_condition' into account #47 (bastien)
- Replaced usage of update_attribute with update_attribute! #45 (kevmoo)
- use self.class.primary_key instead of id in shuffle_positions_on_intermediate_items #42 (servercrunch)
- initialize gem #39 (megatux)
- Added ability to set item positions directly (e.g. In a form) #38 (dubroe)
- Prevent SQL error when position_column is not unique #37 (hinrik)
- Add installation instructions to README.md #35 (mark-rushakoff)
0.1.6 (2012-04-19)
Closed issues:
- eval mistakenly resolved the module path #32
- Duplicated positions when creating parent and children from scratch in 0.1.5 #31
- add info about v0.1.5 require Rails 3 #28
- position not updated with move_higher or move_lover #23
Merged pull requests:
- update ActiveRecord class eval to support ActiveSupport on_load #33 (mergulhao)
- Add :add_new_at option #30 (mjbellantoni)
0.1.5 (2012-02-24)
Closed issues:
- increment_positions_on_lower_items called twice on insert_at with new item #21
- Change bundler dependency from ~>1.0.0 to ~>1.0 #20
- decrement_positions_on_lower_items method #17
- New gem release #16
- acts_as_list :scope => "doesnt_seem_to_work" #12
- don't work perfectly with default_scope #11
- MySQL: Position column MUST NOT have default #10
- insert_at fails on postgresql w/ non-null constraint on position_column #8
Merged pull requests:
- Efficiency improvement for insert_at when repositioning an existing item #27 (bradediger)
- Use before validate instead of before create #25 (webervin)
- Massive test refactorings. #24 (splattael)
- Silent migrations to reduce test noise. #22 (splattael)
- Should decrement lower items after the item has been destroyed to avoid unique key conflicts. #18 (aepstein)
- Fix spelling and grammar #15 (tmiller)
- store_at_0 should yank item from the list then decrement items to avoid r #14 (aepstein)
- Support default_scope ordering by calling .unscoped #13 (tanordheim)
0.1.4 (2011-07-27)
Merged pull requests:
- Fix sqlite3 dependency #7 (joneslee85)
0.1.3 (2011-06-10)
Closed issues:
Merged pull requests: