1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

fix _t function in seed

This commit is contained in:
Du Peng 2020-02-03 11:31:33 +01:00
parent 72f3d8fd1e
commit 767a8cd332

View File

@ -31,7 +31,7 @@ if StatisticField.count.zero?
])
end
unless StatisticField.find_by(key:'groupName').try(:label)
unless StatisticField.find_by(key: 'groupName').try(:label)
field = StatisticField.find_or_initialize_by(key: 'groupName')
field.label = 'Groupe'
field.statistic_index_id = 1
@ -58,7 +58,7 @@ if StatisticSubType.count.zero?
StatisticSubType.create!([
{ key: 'created', label: I18n.t('statistics.account_creation'),
statistic_types: StatisticIndex.find_by(es_type_key: 'account').statistic_types },
{ key: 'published', label:I18n.t('statistics.project_publication'),
{ key: 'published', label: I18n.t('statistics.project_publication'),
statistic_types: StatisticIndex.find_by(es_type_key: 'project').statistic_types }
])
end
@ -222,7 +222,6 @@ if Machine.count.zero?
end
end
if Category.count.zero?
Category.create!(
[
@ -436,7 +435,6 @@ unless Setting.find_by(name: 'training_information_message').try(:value)
setting.save
end
unless Setting.find_by(name: 'fablab_name').try(:value)
setting = Setting.find_or_initialize_by(name: 'fablab_name')
setting.value = 'Fabrique'
@ -449,7 +447,6 @@ unless Setting.find_by(name: 'name_genre').try(:value)
setting.save
end
unless DatabaseProvider.count.positive?
db_provider = DatabaseProvider.new
db_provider.save
@ -648,7 +645,7 @@ unless Setting.find_by(name: 'link_name').try(:value)
name = Setting.find_by(name: 'fablab_name')
gender = Setting.find_by(name: 'name_genre')
setting = Setting.find_or_initialize_by(name: 'link_name')
setting.value = _t('app.public.common.about_the_fablab', NAME: name, GENDER: gender)
setting.value = I18n.t('app.public.common.about_the_fablab', NAME: name, GENDER: gender)
setting.save
end