2014-05-26 07:18:59 +00:00
|
|
|
class RoleStatus
|
|
|
|
include Mongoid::Document
|
|
|
|
field :key, type: String
|
|
|
|
field :title, type: String, localize: true
|
|
|
|
field :disable, type: Boolean, default: false
|
|
|
|
|
|
|
|
scope :can_display, ->{ where(disable: false) }
|
|
|
|
|
2014-06-27 03:38:06 +00:00
|
|
|
has_and_belongs_to_many :member_profiles
|
2014-05-26 07:18:59 +00:00
|
|
|
belongs_to :role
|
|
|
|
|
|
|
|
def self.get_role_data(role_key)
|
|
|
|
@role = Role.find_by(key: role_key)
|
|
|
|
return @role.id
|
|
|
|
end
|
|
|
|
end
|