forked from saurabh/orbit4-5
17 lines
374 B
Ruby
17 lines
374 B
Ruby
class Category
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
|
|
field :disable, type: Boolean, default: false
|
|
field :title, localize: true
|
|
|
|
belongs_to :module_app
|
|
has_many :authorizations
|
|
|
|
scope :enabled, ->{ where(:disable.in => [false, nil, ''])}
|
|
|
|
def category_sub_managers
|
|
Authorization.category_authorized_users(self).pluck(:user_id)
|
|
end
|
|
end
|