Merge branch 'desktop_harry' of github.com:Rulingcom/orbit into desktop_harry

Conflicts:
	Gemfile.lock
	app/assets/javascripts/.DS_Store
	app/assets/stylesheets/style.css.erb
	app/views/layouts/_orbit_bar.html.erb
This commit is contained in:
Christophe Vilayphiou committed 2012-06-29 16:10:29 +08:00
commit a1e74987dc
389 files changed
+6931 -1

No files matched your search

+9
View File
@@ -20,6 +20,9 @@ class User
has_many :privilege_apps, :inverse_of => :privilege_users, :class_name => "AppAuth"
has_many :managing_apps,:class_name => "AppManager"
has_one :desktop, :autosave => true, :dependent => :destroy
has_many :other_accounts, :autosave => true, :dependent => :destroy
has_many :journals, :autosave => true, :dependent => :destroy
belongs_to :role
has_and_belongs_to_many :sub_roles
@@ -49,6 +52,8 @@ class User
Thread.current[:user] = user
end
before_create :initialize_desktop
def avb_apps
sub_role_ids_ary=self.sub_roles.collect{|t| t.id}
query1 = AppAuth.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: self.id)
@@ -81,4 +86,8 @@ class User
User.find(id) rescue nil
end
def initialize_desktop
self.build_desktop
end
end