I am using a single model for acts_as_list
, not sure if it is mandatory to add an associated model.
class TestModel < ApplicationRecord
# need to skip adding a value to position for a specific condition or add position for a specific condition
acts_as_list , if: Proc.new { |test| test.field == 'SomeValue' } # not working
acts_as_list add_new_at: nil, scope: [field: 'SomeValue'] # it adds nil for all cases
acts_as_list scope: [field: 'SomeValue'] # this too is not working adds last position
end
Tried multiple combinations available for acts_as_list
Found other options too for positioing.
- ranked-model
- positioning
Not sure if I can use these two in my case.
2