I have a possibly unique case where I need a model to have two differing orders depending on the model it is joined to. Example as follows:
class Book
acts_as_list :column => :genre, :scope => :genre
acts_as_list :column => :author, :scope => :author
belongs_to :genre
belongs_to :author
end
So basically what I am trying to do is have a Book model which is part of two lists, one for the genre page it appears on, and one for the author page it appears on.
acts_as_list
does not appear to support the use of 2 position columns as methods such as move_to_top
does not allow you to specify which list to move to the top of.
Has anyone got any suggestions on how I could achieve this? Right now I am thinking I will have to create a join table such as books_genres
which has a position
column, but I am really not too keen on that as that requires a whole load of extra tables.
ranked-model
. – Sells