Emin Hasanov
2006-Apr-12 20:36 UTC
[Rails] acts_as_list problem with records coming in and out
I have the model that acts as list acts_as_list :scope => ''featured=1'' As you can see, I only need to order the records that are featured. However, from time to time I switch some featured items off and mark others as featured. When this is done, I start getting dublicate numbers on the list and ordering starts getting problem... What would be the good approach to add/remove items to the featured list while not breaking positions? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/3c311470/attachment.html
Emin Hasanov
2006-Apr-13 06:25 UTC
[Rails] Re: acts_as_list problem with records coming in and out
Anybody having similar problem? I think, one of the ways would be to renumber all the featured items once records goes in or out On 4/13/06, Emin Hasanov <emin@hasanov.com> wrote:> > I have the model that acts as list > > acts_as_list :scope => ''featured=1'' > > As you can see, I only need to order the records that are featured. > However, from time to time I switch some featured items off and mark others > as featured. When this is done, I start getting dublicate numbers on the > list and ordering starts getting problem... > > What would be the good approach to add/remove items to the featured list > while not breaking positions? > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060413/aaf056d8/attachment.html