orbit4-5/app/models/category.rb

17 lines
374 B
Ruby
Raw Normal View History

2014-04-10 09:55:24 +00:00
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
2014-04-10 09:55:24 +00:00
scope :enabled, ->{ where(:disable.in => [false, nil, ''])}
def category_sub_managers
Authorization.category_authorized_users(self).pluck(:user_id)
end
2014-04-10 09:55:24 +00:00
end