27 lines
712 B
Ruby
27 lines
712 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
|
|
|
|
unless Rails.env.test?
|
|
YAML.safe_load(File.read('db/seeds/sites.yml')).each do |site|
|
|
site = Site.find_or_create_by name: site['name']
|
|
|
|
site.update licencia: Licencia.first, design: Design.first,
|
|
title: site.name, description: 'x' * 50,
|
|
deploys: site.deploys.empty? ? [DeployLocal.new] : site.deploys
|
|
end
|
|
end
|