New UI changes(tags, categories, authorisations, module index…)

To run:
  - ruby lib/remove_old_tags.rb DB_NAME
  - rake new_ui:migrate_tags
  - rake new_ui:migrate_categories['APP_KEY,''MODEL_NAME'] (check new_ui.rake for more details)
This commit is contained in:
chris committed 2013-07-02 16:46:44 +08:00
1 parent 07b3857465
commit 856898016b
1495 files changed
+52132 -9876

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@ class Role < Attribute
field :title, localize: true
has_many :sub_roles, :autosave => true, :dependent => :destroy
has_many :users
# has_many :statuses, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :users
has_many :statuses, :autosave => true, :dependent => :destroy
# has_many :attribute_fields, :autosave => true, :dependent => :destroy
has_many :role_statuses, :autosave => true, :dependent => :destroy
has_many :role_categorys, :autosave => true, :dependent => :destroy
+7 -5
View File
@@ -42,7 +42,6 @@ class User
before_create :initialize_desktop
before_save :rebuild_status_record
before_save :save_roles
scope :remote_account, where(:nccu_id.ne => nil)
scope :not_guest_user, all_of(:name.ne => "guest")
@@ -271,12 +270,15 @@ class User
def initialize_desktop
self.build_desktop(desktop_widget_ids: DesktopWidget.all.collect{|widget| widget.id})
end
def managed_module_apps
self.managing_apps.inject([]) do |managed_apps, app_manager|
managed_apps << app_manager.managing_app unless app_manager.managing_app.blank?
managed_apps
end
end
protected
def save_roles
# self.roles = self.sub_roles.collect{|t| t.role}.uniq
self.roles = self.roles.uniq
end
def rebuild_status_record
self.status_record = {}