class Role include Mongoid::Document include Mongoid::Attributes::Dynamic field :key, type: String field :title, type: String, localize: true field :built_in, type: Boolean, default: false field :disabled, type: Boolean, default: false has_and_belongs_to_many :member_profiles has_many :authorizations has_many :attribute_fields accepts_nested_attributes_for :attribute_fields has_many :role_statuses, dependent: :destroy def is_built_in? self.built_in end def is_disabled? self.disabled end end