5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 10:26:21 +00:00
panel/db/seeds.rb
jazzari 3d7394655c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
fix: agrego polizas & codigo de conducta #1278
2023-06-09 12:44:40 -03:00

29 lines
658 B
Ruby

# frozen_string_literal: true
designs = YAML.safe_load(File.read('db/seeds/designs.yml'))
designs.each do |d|
design = Design.find_or_create_by(gem: d['gem'])
design.update d
end
licencias = YAML.safe_load(File.read('db/seeds/licencias.yml'))
licencias.each do |l|
licencia = Licencia.find_or_create_by(icons: l['icons'])
licencia.update l
end
if CodeOfConduct.count.zero?
YAML.safe_load(File.read('db/seeds/codes_of_conduct.yml')).each do |coc|
CodeOfConduct.new(**coc).save!
end
end
if PrivacyPolicy.count.zero?
YAML.safe_load(File.read('db/seeds/privacy_policies.yml')).each do |pp|
PrivacyPolicy.new(**pp).save!
end
end