orbit4-5/app/models/role.rb

26 lines
541 B
Ruby
Raw Normal View History

class Role
include Mongoid::Document
2014-06-16 06:20:51 +00:00
include Mongoid::Attributes::Dynamic
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
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-07-10 06:48:18 +00:00
has_many :role_statuses, dependent: :destroy
2014-05-09 06:03:55 +00:00
def is_built_in?
self.built_in
end
def is_disabled?
self.disabled
end
end