Class: DcPolicyRole
- Inherits:
-
Object
- Object
- DcPolicyRole
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/dc_policy_role.rb
Overview
Mongoid::Document model for dc_policy_roles collection.
Documents in this model define all available user roles in the application. Roles are defined by unique name which is valid for current application or as alternative name (system_name) which can be persistent, when application is used as Rails plugin.
Class Method Summary collapse
-
.choices4_roles ⇒ Object
Return all defined roles as choices for use in select field.
Class Method Details
.choices4_roles ⇒ Object
Return all defined roles as choices for use in select field.
48 49 50 |
# File 'app/models/dc_policy_role.rb', line 48 def self.choices4_roles where(active: true).order_by(name: 1).inject([]) { |r,role| r << [ role.name, role._id] } end |