hitobito_lit/db/seeds/development/0_groups.rb
Philipp Rothmann 135b14c868 init
2022-12-20 16:26:37 +01:00

19 lines
376 B
Ruby

# 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!