List units ordered, not using nested_set

This commit is contained in:
2024-01-09 00:11:26 +01:00
parent 92132768fa
commit 4e91c89153
2 changed files with 9 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ class User < ApplicationRecord
disabled: 0, # administratively disallowed to sign in
}, default: :active
has_many :units, -> { order :lft }, dependent: :destroy
has_many :units, -> { ordered }, dependent: :destroy
def at_least(status)
User.statuses[self.status] >= User.statuses[status]