merge with november_presentation

This commit is contained in:
chris2tof committed 2011-12-20 16:47:17 +08:00
1 parent afbffe37d5
commit a09f8e4551
101 files changed
+891 -10632

No files matched your search

+7
View File
@@ -11,10 +11,17 @@ class User
field :active_role
has_many :attribute_values, :autosave => true, :dependent => :destroy
has_many :app_auths,as: :privilege_apps,:inverse_of => :privilege_lists
has_many :blocked_apps, :inverse_of => :blocked_users, :class_name => "AppAuth"
has_many :privilege_apps, :inverse_of => :privilege_users, :class_name => "AppAuth"
belongs_to :role
has_and_belongs_to_many :sub_roles
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
def avb_apps
query = AppAuth.any_of({all: true},{privilege_user_ids: self.id},{roles: self.role.id}).excludes(blocked_user_ids: self.id)
end
def name
info = Class::Info.first(:conditions => {:key => 'profile'})
if info