Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support For Multiple Indexes #127

Closed
Undistraction opened this issue Jul 2, 2014 · 2 comments
Closed

Add Support For Multiple Indexes #127

Undistraction opened this issue Jul 2, 2014 · 2 comments

Comments

@Undistraction
Copy link

For example:

I have a Gallery that has_many Photos. Each photo needs an position so they can be ordered by hand, for which acts_as_list works great.

However, each photo can be flagged as featured, and a user can order featured photos as well. In this situation a second set of instance methods and separate position is needed that will store and allow manipulation of the photo when in the context of a list of featured photos.

photo.list(:some_gallery).move_higher
photo.list(:favourites).move_higher
@andreasknoepfle
Copy link

is there any particular reason why this was closed ? It would indeed be pretty nice and way more configurable to have that
Maybe like:

class Photo
  acts_as_list column: :priority 
  acts_as_list column: :gallery_position
end

photo.move_higher_in_priority
photo.move_higher_in_gallery_position

While the default methods (move_higher, move_lower) are only available when acts_as_list are only available for the first call of acts_as_list.

@brendon
Copy link
Owner

brendon commented Apr 15, 2016

It does sound like an interesting idea. It was closed by the author or the issue though, so perhaps they changed their mind.

We'd happy accept a pull request with tests for this feature, but none of us have the time to develop it right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants