2014-05-01 07:14:16 +00:00
|
|
|
class Role
|
|
|
|
include Mongoid::Document
|
2014-06-16 06:20:51 +00:00
|
|
|
include Mongoid::Attributes::Dynamic
|
|
|
|
|
2014-05-01 07:14:16 +00:00
|
|
|
field :key, type: String
|
|
|
|
field :title, type: String, localize: true
|
2014-06-16 06:20:51 +00:00
|
|
|
field :built_in, type: Boolean, default: false
|
|
|
|
field :disabled, type: Boolean, default: false
|
2014-05-01 07:14:16 +00:00
|
|
|
|
|
|
|
has_and_belongs_to_many :member_profiles
|
|
|
|
has_many :authorizations
|
2014-06-16 06:20:51 +00:00
|
|
|
|
|
|
|
has_many :attribute_fields
|
|
|
|
accepts_nested_attributes_for :attribute_fields
|
|
|
|
|
2014-05-26 07:18:59 +00:00
|
|
|
has_many :role_statuses
|
2014-05-09 06:03:55 +00:00
|
|
|
|
|
|
|
def is_built_in?
|
|
|
|
self.built_in
|
|
|
|
end
|
|
|
|
|
|
|
|
def is_disabled?
|
|
|
|
self.disabled
|
|
|
|
end
|
2014-05-01 07:14:16 +00:00
|
|
|
end
|