Add Units

This commit is contained in:
2023-07-06 18:34:16 +02:00
parent 6f415dfb62
commit a4745c9cb8
21 changed files with 285 additions and 15 deletions

View File

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