Actualizar plugin Additionals a 3.0.0

This commit is contained in:
Manuel Cillero 2020-11-22 21:30:25 +01:00
parent 3d976f1b3b
commit a26f5567af
399 changed files with 70374 additions and 4093 deletions

View file

@ -0,0 +1,22 @@
class CreateDashboardDefaults < ActiveRecord::Migration[5.2]
def up
User.current = User.find_by(id: ENV['DEFAULT_USER_ID'].presence || User.admin.active.first.id)
unless Dashboard.exists?(dashboard_type: DashboardContentWelcome::TYPE_NAME)
Dashboard.create! name: 'Welcome dashboard',
dashboard_type: DashboardContentWelcome::TYPE_NAME,
system_default: true,
author_id: User.current.id,
visibility: 2
end
return if Dashboard.exists?(dashboard_type: DashboardContentProject::TYPE_NAME)
Dashboard.create! name: 'Project dashboard',
dashboard_type: DashboardContentProject::TYPE_NAME,
system_default: true,
enable_sidebar: true,
author_id: User.current.id,
visibility: 2
end
end