2011-12-23 10:34:21 +00:00
|
|
|
class SubRole < Attribute
|
|
|
|
|
2012-01-24 07:12:06 +00:00
|
|
|
belongs_to :role
|
2011-12-23 10:34:21 +00:00
|
|
|
has_and_belongs_to_many :users
|
2012-09-17 04:06:21 +00:00
|
|
|
#has_and_belongs_to_many :statuses, :autosave => true, :dependent => :destroy
|
|
|
|
has_and_belongs_to_many :tags, :class_name => "SubRoleTag", :autosave => true
|
|
|
|
|
2011-12-23 10:34:21 +00:00
|
|
|
# Get an sub_role from key
|
|
|
|
def self.get_sub_role_from_key(key)
|
|
|
|
self.first(:conditions => {:key => key})
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|