hitobito_lit/db/seeds/development/0_groups.rb

20 lines
376 B
Ruby
Raw Normal View History

2022-12-20 16:26:37 +01:00
# frozen_string_literal: true
require Rails.root.join('db', 'seeds', 'support', 'group_seeder')
seeder = GroupSeeder.new
root = Group.roots.first
srand(42)
if root.address.blank?
root.update(seeder.group_attributes)
root.default_children.each do |child_class|
child_class.first.update(seeder.group_attributes)
end
end
# TODO: define more groups
Group.rebuild!