1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) unable to run when first setup Fab-manager

This commit is contained in:
Du Peng 2023-02-09 11:52:13 +01:00
parent 7fe495925c
commit 8369a66c7c
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,7 @@
# Changelog Fab-manager
- Fix a bug: unable to run `rails db:seed` when first setup Fab-manager
## v5.6.11 2023 February 07
- OpenAPI endpoint to fetch subscription data

View File

@ -4,9 +4,7 @@
# Some of them are just some placeholders to prevent having an empty palce when starting fab-manager first.
# Other data are required default values, for various settings.
Dir[Rails.root.join('db/seeds/**/*.rb')].sort.each do |seed|
load seed
end
load Rails.root.join('db/seeds/statistics.rb')
if Group.count.zero?
Group.create!([
@ -27,6 +25,8 @@ if Role.where(name: 'admin').joins(:users).count.zero?
admin.save!
end
load Rails.root.join('db/seeds/settings.rb')
if Component.count.zero?
Component.create!([
{ name: 'Silicone' },