This repository has been archived on 2024-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
orbit-4-1/app/models/user/sub_role.rb
T
2012-09-17 13:32:52 +08:00

13 lines
366 B
Ruby

class SubRole < Attribute
belongs_to :role
has_and_belongs_to_many :users
#has_and_belongs_to_many :statuses, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :tags, :class_name => "SubRoleTag", :autosave => true
# Get an sub_role from key
def self.get_sub_role_from_key(key)
self.first(:conditions => {:key => key})
end
end