ranked-model icon indicating copy to clipboard operation
ranked-model copied to clipboard

Not setting the rank when creating a new object

Open dlynam opened this issue 7 years ago • 1 comments

Is there any way to not set the rank when creating a new object? For example, if I have

class Car < ActiveRecord::Base
  ranks :rank
end

Can I save a new Car object and keep the rank field nil?

dlynam avatar Dec 10 '17 22:12 dlynam

Hi @dlynam, I don't believe so. The point of the rank is that everything in the scope has a rank. You could try scoping in such a way that the non-ranked car is outside the scope, then it wouldn't receive a rank?

brendon avatar Mar 18 '19 20:03 brendon

Closing due to inactivity.

brendon avatar Jun 04 '24 08:06 brendon